Hi folks,
First up, please don't suggest I do this in the cube!
I'm trying to add a formula to the data analysis panel for one of my visualisations, in order to calculate the rank of each row. I need the rank so I can colour my visualisation accordingly (it's a diagram). There doesn't appear to be a rank function that you can use in formulae built-in to Dundas.
I've tried this gem, but to no avail:
if ($MyMeasure$ == RANKVAL($MyMeasure$,1)) {
return 1
}
if ($MyMeasure$ == RANKVAL($MyMeasure$,2)) {
return 2
}
...
return 12
The problem is that if there are only, say, 5 results in the data, RANKVAL returns something that is null, or empty, or something. Can I check for this somehow? Is there any other, less filthy, way of doing it - without changing the cube?
Btw, I don't want to modify the cube because it is used in other visualisations, and I'm trying to keep my re-work to a minimum. If there is no other possible way to do this, then I guess that's my decision made.
Thanks,
Rob