Crosstab aggregate on problem [message #247786] |
Fri, 13 July 2007 12:22 ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: sebastien.kloeckner.nqicorp.com
Hello,
I am a new Birt user and i discover recently the crosstab.
I have a problem to change the computed value from the 'aggregate on' part
of the crosstab.
I will try to explain what i try to do... :]
I have some datas in my table:
Table Activities
- project : name of the project
- task : name of the task
- date : date of the activity
- timespent : time spent in the activity in minutes
- ....
I try to make a report that looks like this (final report should have
parameter to customize the timespent display)
Day 1 | ... | Day i | ... | Day n | Total
____________________________________________________________ __________
project 1 - Task 1 | 02:30 | ... | 00:00 | ... | 04:30 | 32:30
------------------------------------------------------------ ----------
Task 2 | 00:30 | ... | 00:00 | ... | 00:00 | 02:30
------------------------------------------------------------ ----------
project 2 - Task 1 | 01:30 | ... | 00:00 | ... | 01:30 | 04:00
------------------------------------------------------------ ----------
....
____________________________________________________________ __________
Total | 03:30 | ... | 00:00 | ... | 06:00 | 39:00
I have a cube with :
- 2 groups [date] and [project]->[task]
- 1 measure : timespent
I can put an expression to change the value of the measure (from 150 to
02:30) by calling a script function (i change in the expression builder
the value measure["timespent"] to my_function(measure["timespent"])).
But i cannot find a similar way to change the aggregate value... :[... I
always got '1950' where i need '32:30'
Is there something i missing (like an expression builder on the aggregate
on editor) ?
or is there a work-around to be able to do this ??
Thanks per advance and sorry for my poor english... :]
Seb K
|
|
|
Re: Crosstab aggregate on problem [message #247987 is a reply to message #247786] |
Mon, 16 July 2007 07:45 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Tianli Zhang![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=tzhang%40actuate.com) Messages: 2862 Registered: July 2009 |
Senior Member |
|
|
Hi kloeckner,
Thanks for your scenario, first the aggregation build can only specify the
data field, and the data field can not be edit or modify the expression,
so in your case the total of time spent can not set script method.
I have tried your scenario and find a workaround solution, following is my
steps:
1, I define a timespent measure in cube builder and the data type is
Integer
2, Drag it into crosstab, and modify the expression to
new java.sql.Time(measure["timespent"]); data type is Time
3, Add a grandtotal(aggregation)on measure timespent
4, Drag a dataitem from palette into the grandtotal's aggregation area,
specify exprssion to new java.sql.Time(data["xxxx"]). make sure the xxxx
is as same as your grandtotal's binding name. In another word the new
dataitem is refrenced your grandtotal's data binding.
Ok that's all my solution, the new dataitem can display what you want. The
most important is the data field's expression of aggregation builder can
not be modify. The user should be insert another dataitem and reference to
that aggregation's binding. The user just define script functions on that
binding.
I don't know whether I described that clearly, I hope my solution can help
you work out that case.
|
|
|
Re: Crosstab aggregate on problem [message #248017 is a reply to message #247987] |
Mon, 16 July 2007 08:55 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: sebastien.kloeckner.nqicorp.com
> Hi kloeckner,
>
> Thanks for your scenario, first the aggregation build can only specify
> the data field, and the data field can not be edit or modify the
> expression, so in your case the total of time spent can not set script
> method.
>
> I have tried your scenario and find a workaround solution, following is
> my steps:
> 1, I define a timespent measure in cube builder and the data type is
> Integer
> 2, Drag it into crosstab, and modify the expression to new
> java.sql.Time(measure["timespent"]); data type is Time
> 3, Add a grandtotal(aggregation)on measure timespent
> 4, Drag a dataitem from palette into the grandtotal's aggregation area,
> specify exprssion to new java.sql.Time(data["xxxx"]). make sure the xxxx
> is as same as your grandtotal's binding name. In another word the new
> dataitem is refrenced your grandtotal's data binding.
>
> Ok that's all my solution, the new dataitem can display what you want.
> The most important is the data field's expression of aggregation builder
> can not be modify. The user should be insert another dataitem and
> reference to that aggregation's binding. The user just define script
> functions on that binding.
> I don't know whether I described that clearly, I hope my solution can
> help you work out that case.
>
Great thanks Tianli for this workaround.
That works perfectly for me and fulfill my needs.. :]
Thanks for your help,
Seb K
|
|
|
|
Re: Crosstab aggregate on problem [message #248510 is a reply to message #247987] |
Tue, 17 July 2007 23:39 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Rima Kanguri![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=rkanguri%40actuate.com) Messages: 110 Registered: July 2009 |
Senior Member |
|
|
One comment i have on this use case is, the steps suggested by Tianli is the
solution and not a work around. We don't support specifying expression for
data field in the aggregation builder.
--Rima Kanguri
"Tianli" <tzhang@actuate.com> wrote in message
news:d3ad421f220921c7417015d5438c64f3$1@www.eclipse.org...
> Hi kloeckner,
>
> Thanks for your scenario, first the aggregation build can only specify the
> data field, and the data field can not be edit or modify the expression,
> so in your case the total of time spent can not set script method.
>
> I have tried your scenario and find a workaround solution, following is my
> steps:
> 1, I define a timespent measure in cube builder and the data type is
> Integer
> 2, Drag it into crosstab, and modify the expression to
> new java.sql.Time(measure["timespent"]); data type is Time
> 3, Add a grandtotal(aggregation)on measure timespent
> 4, Drag a dataitem from palette into the grandtotal's aggregation area,
> specify exprssion to new java.sql.Time(data["xxxx"]). make sure the xxxx
> is as same as your grandtotal's binding name. In another word the new
> dataitem is refrenced your grandtotal's data binding.
>
> Ok that's all my solution, the new dataitem can display what you want. The
> most important is the data field's expression of aggregation builder can
> not be modify. The user should be insert another dataitem and reference to
> that aggregation's binding. The user just define script functions on that
> binding.
> I don't know whether I described that clearly, I hope my solution can help
> you work out that case.
>
|
|
|
Powered by
FUDForum. Page generated in 0.05201 seconds