Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Cross Tab export to dataSet
Cross Tab export to dataSet [message #903625] Fri, 24 August 2012 15:10 Go to next message
SHENG HUANG is currently offline 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 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

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 #903920 is a reply to message #903642] Mon, 27 August 2012 09:43 Go to previous messageGo to next message
SHENG HUANG is currently offline SHENG HUANG
Messages: 17
Registered: August 2012
Junior Member
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)


HUANG Sheng
Re: Cross Tab export to dataSet [message #904031 is a reply to message #903920] Mon, 27 August 2012 15:31 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

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 #908010 is a reply to message #904031] Tue, 04 September 2012 14:42 Go to previous messageGo to next message
SHENG HUANG is currently offline SHENG HUANG
Messages: 17
Registered: August 2012
Junior Member
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.


HUANG Sheng
Re: Cross Tab export to dataSet [message #908051 is a reply to message #908010] Tue, 04 September 2012 15:48 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

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 Go to previous messageGo to next message
SHENG HUANG is currently offline 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 #910992 is a reply to message #910900] Mon, 10 September 2012 19:15 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Look at the attached modified design. I did not need script. Just added a derived measure and put a visibility expression on a couple of items.

Jason
Re: Cross Tab export to dataSet [message #911226 is a reply to message #910992] Tue, 11 September 2012 07:59 Go to previous messageGo to next message
SHENG HUANG is currently offline SHENG HUANG
Messages: 17
Registered: August 2012
Junior Member
Here's the report that I've previewed and exported in format .doc.

I've seen the difference is always that of the totals but not of every month.
I don't know if this is because of the version of the BIRT, but it doesn't work actually on my pc.


HUANG Sheng
Re: Cross Tab export to dataSet [message #911405 is a reply to message #911226] Tue, 11 September 2012 14:34 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

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 Go to previous messageGo to next message
SHENG HUANG is currently offline SHENG HUANG
Messages: 17
Registered: August 2012
Junior Member
It works well with this expression. Thank you.

But I need to do more Very Happy.

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 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

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 #912988 is a reply to message #912485] Fri, 14 September 2012 14:46 Go to previous messageGo to next message
SHENG HUANG is currently offline SHENG HUANG
Messages: 17
Registered: August 2012
Junior Member
The sort of the rows works nice.

Here's my rptdesign actual and the .doc to explain more for my problem of the presentation and the sum. (I hope to be more clear avec this.)


HUANG Sheng
Re: Cross Tab export to dataSet [message #913077 is a reply to message #912988] Fri, 14 September 2012 18:19 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

I do not know of a way of implementing 2 using BIRT 2.3.2. To move diff up, you could use a grid in the header. See attached.

Jason
Re: Cross Tab export to dataSet [message #915404 is a reply to message #913077] Mon, 17 September 2012 08:00 Go to previous messageGo to next message
SHENG HUANG is currently offline SHENG HUANG
Messages: 17
Registered: August 2012
Junior Member
What a pity! Almost, all the data is OK, but it's strange to have a empty row in the report. As I indicate above, the version of BIRT can't be changed recently in my situation.

How about my initial idea, to export all the data of the cross table in to a array and re-organzied the presentation in another dataSet, is it possible?


HUANG Sheng
Re: Cross Tab export to dataSet [message #915641 is a reply to message #915404] Mon, 17 September 2012 17:17 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

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 #915931 is a reply to message #915641] Tue, 18 September 2012 08:35 Go to previous messageGo to next message
SHENG HUANG is currently offline SHENG HUANG
Messages: 17
Registered: August 2012
Junior Member
Sorry, Embarrassed, I meant the empty column.
Here's the .doc with the last .rptdesign given. This time, I've got an empty row and an empty column.

If none of other solution works, could you help me and give me examples for
1. how to fill my array with the data of crosstab
2. how to create a dataSet with an array

Thank you in advance.


HUANG Sheng
Re: Cross Tab export to dataSet [message #916150 is a reply to message #915931] Tue, 18 September 2012 16:10 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

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
Re: Cross Tab export to dataSet [message #916582 is a reply to message #916150] Wed, 19 September 2012 07:42 Go to previous message
SHENG HUANG is currently offline SHENG HUANG
Messages: 17
Registered: August 2012
Junior Member
Thank you very much.
I'll test it and try to remake my presentation in the new dataSet.


HUANG Sheng
Previous Topic:Last modified date of the report
Next Topic:switch from 2.3.0 to 2.3.1, "Processing please wait" never ends in jboss birt runtime
Goto Forum:
  


Current Time: Sat Oct 25 14:36:07 GMT 2014

Powered by FUDForum. Page generated in 0.12125 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software