Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi everybody,
we have a dimension - code and value ( 1,2,3,4 ) ( bad,good,better,best ).
is it possible to see on chart the sum of ( 1,2,3 ) BUT with description ( good,better,best ).
dont ask me why ..
thanks.
Of course you are right. I was too sloppy with copy & paste ...
- Marcus
You could use dual() for it like:
...
if(code = 1, dual('bad', 1),
if(code = 1, dual('good', 2),
if(code = 1, dual('better', 3),
if(code = 1, dual('best', 4))))) as CodeAndDescription,
...
- Marcus
If you don't want to do this in script, you can use this as your dimension
Pick(code, 'Good', 'Better', 'Best')
Marcus -
I think you forgot to change the code for each of the if
if(code = 1, dual('bad', 1),
if(code = 2, dual('good', 2),
if(code = 3, dual('better', 3),
if(code = 4, dual('best', 4))))) as CodeAndDescription,
Of course you are right. I was too sloppy with copy & paste ...
- Marcus
yea ..
Yaniv,
you want to sum codes, and then show the description?
The sum could easily be larger than the max code, right? What would be the description then?
Or do you want to calculate the average and show the corresponding description (for the rounded average)?
What is the context you are using the sum/ average? What is the dimension you are using in your chart?
And what is the title of this post telling with regard to the rest of your post?
A lot of open questions to me.
If you want to lookup a description based on your aggregated code, you could maybe use Only() function or FieldValue()/FieldIndex(), like discussed in
HI Stefan , thanks for help!