Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm thinking the only easy way to do this is precalc via load script, but just in case anyone has a simple solution: I want to use an aggregate as a calculated dimension in a crosstab, e.g.
=aggr(sum(value),CustomerID)
I can wrap this into a class to get me some groups as the dimension, e.g.
=class(aggr(sum(value),CustomerID),5)
Which will give me equal size divisions of my sum(value) expression, in this case 5
But what if I want an uneven class, e.g.
0-5
6-10
11-50
51-100
any ideas?
Thanks
It might be slow, but a series of IFs? Not sure if I'm doing this exactly right:
aggr(only(if(sum(value)<= 5,dual('0-5' , 5)
,if(sum(value)<= 10,dual('6-10' , 10)
,if(sum(value)<= 50,dual('11-50' , 50)
,if(sum(value)<=100,dual('51-100',100)
,dual('101+' ,999)))))),CustomerID)
I dont think that the label can be change, cause is calculated by the class() function, but it writes"<=" and "<" so, there are not closed intervals
=class(Aggr(Sum(value),CustomerID),5) | Count (CustomerID) |
---|---|
6 | |
5 <= x < 10 | 1 |
10 <= x < 15 | 1 |
15 <= x < 20 | 1 |
25 <= x < 30 | 1 |
0 <= x < 5 | 2 |
c ya!
I am sorry that if this is out of context,
but is this solution the only way to do an uneven class?
I have a case where i need to make it also combined with a slowly changing dimension (i need to keep track of when the classes changed) but that's another issue
i think basically what is needed is someway to do (interval match) in layout
anyways hope im not disturbing
(i hope you did find another solution since 2009)