Cross Tab export to dataSet [message #903625] |
Fri, 24 August 2012 15:10 |
SHENG HUANG Messages: 17 Registered: August 2012 |
Junior Member |
|
|
I've some problems with the calculation in the cross tab.
1. I need to calculate a difference between deux types de colonnes.
2. I need also to calculate a difference between deux lignes.
For example,
OK | KO
Jan N1_OK | N1_KO
Fev N2_OK | N2_KO
I want to calcul the difference between the number of OK et KO (For example N1_OK-N1_KO)
I want to calul the difference avec the month above. (For example N2_KO-N1_KO)
I don't find how to do it with the option "Add derive mesure". If it's possible, can someone help me?
Is it possible to export the result of the cross tab in a dataSet which i can do many types the calcul and configure the presentation of my table more simplely?
Thank you in advance
HUANG Sheng
|
|
|
Re: Cross Tab export to dataSet [message #903642 is a reply to message #903625] |
Fri, 24 August 2012 16:12 |
|
Have you tried adding the derived measure to the cube:
http://birtworld.blogspot.com/2012/03/birt-372-new-features.html
Jason
On 8/24/2012 11:10 AM, SHENG HUANG wrote:
> I've some problems with the calculation in the cross tab.
>
> 1. I need to calculate a difference between deux types de colonnes.
> 2. I need also to calculate a difference between deux lignes.
> For example,
> OK | KO
> Jan N1_OK | N1_KO
> Fev N2_OK | N2_KO
> I want to calcul the difference between the number of OK et KO (For
> example N1_OK-N1_KO)
> I want to calul the difference avec the month above. (For example
> N2_KO-N1_KO)
>
> I don't find how to do it with the option "Add derive mesure". If it's
> possible, can someone help me?
>
> Is it possible to export the result of the cross tab in a dataSet which
> i can do many types the calcul and configure the presentation of my
> table more simplely?
>
> Thank you in advance
|
|
|
|
Re: Cross Tab export to dataSet [message #904031 is a reply to message #903920] |
Mon, 27 August 2012 15:31 |
|
I do not know an easy way of doing this. The only thing I can think of
is to create a map or js array with the values in it using crosstab script.
Jason
On 8/27/2012 5:43 AM, SHENG HUANG wrote:
> Thanks for your reponse.
>
> I actuaully use the version 2.3 of BIRT and I will test the new version
> later.
>
> But is it possible to export the result of the crossover table into a
> dataSet?
> (This can help me to manipulate it easier in both presentation and
> calculation)
|
|
|
|
Re: Cross Tab export to dataSet [message #908051 is a reply to message #908010] |
Tue, 04 September 2012 15:48 |
|
I do not have an example for this, but if you can put your data in csv
and write a sample report from it that I can run, I can probably help
you with a work around.
Jason
On 9/4/2012 10:42 AM, SHENG HUANG wrote:
> Have you an example/a link of the case to write a crosstab script, please?
>
> I'm argee that to do something like this is not clean. The version of
> the BIRT that I use can't be changed recently, so I'll try it anyway.
>
> Thanks again.
|
|
|
Re: Cross Tab export to dataSet [message #910900 is a reply to message #908051] |
Mon, 10 September 2012 15:32 |
SHENG HUANG Messages: 17 Registered: August 2012 |
Junior Member |
|
|
I've exported a example of the data in the csv file and here's a example of rptdesign that I've realised.
My original purpose is to add one or more rows to calculate the difference between "PREVUE" and "REALISE" and also the percent of the total "REALISE" for every month. Avec version 2.3 of the BIRT, it's not easy.
Actually, I've to get every data in a global variable avec a dataSet different and calculate the table manually. I'm looking for a solution in cross tab because i've got similar report to make and I've got much more the data which i can no more do it manually.
If I can construct a dataSet avec a cross tab, this can help me much to progress in the subject.
I'm also open for other advices.
Thank you.
HUANG Sheng
[Updated on: Mon, 10 September 2012 15:36] Report message to a moderator
|
|
|
|
|
Re: Cross Tab export to dataSet [message #911405 is a reply to message #911226] |
Tue, 11 September 2012 14:34 |
|
Try this expression for the derived measure:
if( data["TYPE"] == "PREVUE" ){
gblprev = data["NB_Group/month_Group2/TYPE"];
data["NB_Group/month_Group2/TYPE"];
}else{
gblprev-data["NB_Group/month_Group2/TYPE"];
}
Jason
|
|
|
Re: Cross Tab export to dataSet [message #911792 is a reply to message #911405] |
Wed, 12 September 2012 10:30 |
SHENG HUANG Messages: 17 Registered: August 2012 |
Junior Member |
|
|
It works well with this expression. Thank you.
But I need to do more .
1. I need a difference cumulative which means the month of February shoule add the number of the January and so on for the rest.
I tried this :
if( data["TYPE"] == "PREVUE" ){
gblprev += data["NB_Group/month_Group2/TYPE"];
data["NB_Group/month_Group2/TYPE"];
}else{
gblprev = gblprev-data["NB_Group/month_Group2/TYPE"];
gblprev;
}
After declare gblprev in the initilize script, it looks like OK.
Another problem is that how BIRT order those datas, why "PREVUE" is showed before "REALISE"? Can I change this order? And does the expression depends also on the order?
2. And I need also two rows which caculates the total of the "REALISE" (the sum of all the critique 0 and 1) and "PREVUE" for every month, i've tried several times sub Totals and grand Totals, none of them works as I wished. Can you also help me on this subject?
3. At last, the presentation problem, how can I make the title "diff" in the same line of type and cache compeletely the empty row in the "PREVUE" row properly?
Here's in the attached doc a example that I'm looking for. (I also want to change the order of REALISE and PREVUE if possible.)
HUANG Sheng
[Updated on: Wed, 12 September 2012 13:35] Report message to a moderator
|
|
|
Re: Cross Tab export to dataSet [message #912485 is a reply to message #911792] |
Thu, 13 September 2012 16:51 |
|
1 - you should be able to add a sort on the crosstab that contains the dimension that has REALISE and PREVUE, just sort them descending.
2 - Not sure what you are looking for. Can you create an image that shows what you need?
3 - I am not sure what you mean.
Jason
|
|
|
|
|
|
Re: Cross Tab export to dataSet [message #915641 is a reply to message #915404] |
Mon, 17 September 2012 17:17 |
|
You could create a js array while creating the xtab and use it later, either in a grid or a table with a scripted data set. But before going that route, you said there was an empty row. I did not see that in your doc file.
Jason
|
|
|
|
Re: Cross Tab export to dataSet [message #916150 is a reply to message #915931] |
Tue, 18 September 2012 16:10 |
|
Look at the modified example. I created two arraylist in the beforeFactory. I loaded the array lists in the expression for diff. Next the scripted data set reads the list and displays them in a table.
Jason
|
|
|
|
Powered by
FUDForum. Page generated in 0.07015 seconds