Calculated value with If statement

Anyone have a jsfiddle example on using calculated value using if statement
What I want to see is
If colorColumn=red then numBasketballColumn / numRedBallColumn
else if colorColumn=white then numSoccorColumn / numWhiteBallColumn
else if ….
else …
Is is like 
SyntaxEditor Code Snippet

 measures: [ 
        {uniqueName: 'Calculated Field', formula: ""If(,,)"", calculated: true },

1 answer

Iryna Kulchytska Staff April 20, 2016

Hello David,
Here is a jsfiddle example on using calculated value with if statement:
You cannot compare hierarchy members in it, you can address measures (Price, Quantity) and their values.
Please let me know if the sample works for you.
Kind regards,

Please login or Register to Submit Answer