Home » Archived » BIRT » Data Cube - conditional aggregation(Data Cube - conditional aggregation)
Data Cube - conditional aggregation [message #1758284] |
Mon, 27 March 2017 06:00 |
v k Messages: 1 Registered: March 2017 |
Junior Member |
|
|
Hello,
I have had a quick search through the topics and nothing is quite like the problem I have.
I'm very new to BIRT so please go easy on me if I ask something stupid.
I am using a data cube to group and perform calculations on an underlying data set.
In a nutshell I can get as far as data that looks like
key, date, val1, val2, %diff
X, 1-jan-2017, 2, 1, -0.5
X, 2-jan-2017, 1, 1, 0.0
X, 3-jan-2017, 1, 1, 0.5
Y, 1-jan-2017, 3, 4, 0.25
Y, 2-jan-2017, 4, 4, 0.0
Y, 3-jan-2017, 4, 4, 0.0
In my cube key and date are a 'group', val1 and val2 are measures and %diff is a derived measure.
I have a kind of aggregation to perform on the %diff column - basically for each key just multiply all the numbers together except if that number is zero (for obvious reasons ).
In the above example, that single number for key 'X' would be: -0.5*0.5 = -0.25 (as the 0.0 row is omitted)
And for 'Y' would be: 0.25 (as both the 0.0 rows are omitted)
Question 1, then is how do I do this kind of selective aggregation in a data cube?
Question 2, my ultimate goal is to produce a single table that display this single result by key - like:
key, result
X, -0.25
Y, 0.25
Any help is greatly appreciated!
|
|
|
Goto Forum:
Current Time: Sat Sep 21 22:40:53 GMT 2024
Powered by FUDForum. Page generated in 0.02652 seconds
|