Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Let user choice the dimension in datacube
Rin
Hello,<br />
<br />
When using data cube with cross tab in BIRT for some aggregation reporting, I define the dimension for the cube using expression like <em class='bbc'>dimension["Group Name"]["Column Name"]</em>. Is there a way to let user to choice the dimension that the aggregate working on please?<br />
<br />
I tried to use a parameter in the expression, like <em class='bbc'>dimension["Group Name"][params["the_column_that_user_want_to_do_aggregate_on"].value]</em>, but it didn't work.<br />
<br />
For example ,I have a table with 4 tuples.<br />
<br />
Area id price sell<br />
NY a 1123 421<br />
NY a 5212 100<br />
NY b 4092 200<br />
NJ b 1245 401<br />
<br />
where area, id, price,sell is the columns name<br />
<br />
I firstly create a data set Set1 with:<br />
<em class='bbc'>select * from table<br />
where sell > 150</em> <br />
<br />
Then I create a data cube on Set1, which called cube1, then create some aggregation in Summary Fields. Finally I create a cross tab to display the results.<br />
<br />
But since the dimension expression is fixed in the cross tab, users can not decided the dimension they want to do the aggregation on.
Find more posts tagged with
Comments
mwilliams
Can you explain more about your question? What is the user choosing? The dimensions in the crosstab or something else? If they're choosing the dimension, what are their choices? Are they dynamic or limited? Let me know.
Rin
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="79133" data-time="1309199808" data-date="27 June 2011 - 11:36 AM"><p>
Can you explain more about your question? What is the user choosing? The dimensions in the crosstab or something else? If they're choosing the dimension, what are their choices? Are they dynamic or limited? Let me know.<br /></p></blockquote>
<br />
Hello mwilliams,<br />
<br />
I posted the unfinished post by a mistake-click.<br />
<br />
I just finished editing my post : )<br />
<br />
<br />
<span class='bbc_underline'>What is the user choosing?</span><br />
<br />
The user is choosing which dimension he want to do the aggregation. <br />
<br />
<span class='bbc_underline'>The dimensions in the crosstab or something else?</span><br />
In the corsstab, which is also in the group(dimensions) of data cube<br />
<br />
<br />
<span class='bbc_underline'>If they're choosing the dimension, what are their choices? </span><br />
Their choices are columns.<br />
<br />
with a table like<br />
<br />
area id price sell<br />
NY a 1123 421<br />
NY a 5212 100<br />
NY b 4092 200<br />
NJ b 1245 401<br />
<br />
If he choice "id", the result will be like<br />
<br />
id price sell<br />
a 6335 521<br />
b 5337 601<br />
<br />
<br />
If he choice "area", then:<br />
Area price sell<br />
NY 10428 521<br />
NJ 1245 401<br />
<br />
<br />
<br />
<span class='bbc_underline'>Are they dynamic or limited? </span><br />
The dimension that user can choose from is limited. In the example above, the user can only choice <strong class='bbc'>area</strong> or <strong class='bbc'>id</strong>
mwilliams
The simplest way to do it if you're using the designer would probably be to design the crosstab in the available ways and then when you ask the user what they want to see, you'd just drop the unneeded ones from the design in the beforeFactory script.
Rin
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="79136" data-time="1309201632" data-date="27 June 2011 - 12:07 PM"><p>
The simplest way to do it if you're using the designer would probably be to design the crosstab in the available ways and then when you ask the user what they want to see, you'd just drop the unneeded ones from the design in the beforeFactory script.<br /></p></blockquote>
<br />
It sounds good!<br />
<br />
Is there any references with the script that dropping some elements please?<br />
<br />
Thanks
mwilliams
Here's a link to the current documentation:
http://www.birt-exchange.com/be/downloads/documentation/#currentdocs
Here's an example that drops a table, but it would be the same process:
http://www.birt-exchange.org/org/devshare/designing-birt-reports/1027-drop-a-table-based-on-a-report-parameter/
Rin
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="79142" data-time="1309206037" data-date="27 June 2011 - 01:20 PM"><p>
Here's a link to the current documentation:<br />
<br />
<a class='bbc_url' href='
http://www.birt-exchange.com/be/downloads/documentation/#currentdocs'>http://www.birt-exchange.com/be/downloads/documentation/#currentdocs</a><br
/>
<br />
Here's an example that drops a table, but it would be the same process:<br />
<br />
<a class='bbc_url' href='
http://www.birt-exchange.org/org/devshare/designing-birt-reports/1027-drop-a-table-based-on-a-report-parameter/'>http://www.birt-exchange.org/org/devshare/designing-birt-reports/1027-drop-a-table-based-on-a-report-parameter/</a><br
/></p></blockquote>
<br />
It works ^^<br />
Thanks in deed!
mwilliams
Not a problem. Glad to help. Let us know whenever you have questions!
Rin
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="79147" data-time="1309207885" data-date="27 June 2011 - 01:51 PM"><p>
Not a problem. Glad to help. Let us know whenever you have questions!
<br /></p></blockquote>
<br />
<br />
<br />
If we have a lot of columns which can be selected by user,(e.g. 200 columns),and we need to add other columns in future. It seems not flexible to do the job by drop all the other cross tabs each time after user select one. Is there a way to create a cross tab on the fly with the dimension that user want to see please?<br />
<br />
Thanks in advance : D
mwilliams
This devShare post should help get you started on building dynamic dataCubes and crosstabs:
http://www.birt-exchange.org/org/devshare/deploying-birt-reports/1043-create-data-cube--xtab-de-api-example/
Rin
Thank you mwilliams, it's quite helpful.