Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
yanivvl0
Creator III
Creator III

How to Shift dimension description one position to the left ?

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.

1 Solution

Accepted Solutions
marcus_sommer

Of course you are right. I was too sloppy with copy & paste ...

- Marcus

View solution in original post

7 Replies
marcus_sommer

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

sunny_talwar

If you don't want to do this in script, you can use this as your dimension

Pick(code, 'Good', 'Better', 'Best')

sunny_talwar

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,

marcus_sommer

Of course you are right. I was too sloppy with copy & paste ...

- Marcus

yanivvl0
Creator III
Creator III
Author

yea ..

swuehl
MVP
MVP

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

Missing Manual - FieldIndex()

yanivvl0
Creator III
Creator III
Author

HI Stefan , thanks for help!