Ok, here I am again bothering you guys.
This time my question is:
I know we can use a formula -- like Formula=(MeasureX=0?(-1):MeasureX) to change the value 0 of that measure to -1
But, can I use a formula to change many values?
Like change 0 for -1, 10 for -2, 20 for -3 and so on.
It is currently April 26th, 2024, 9:37 pm
Can I use a calc formula to change many values in a measure?
-
- Posts: 46
- Joined: January 29th, 2010, 3:39 pm
-
- Developer
- Posts: 263
- Joined: July 31st, 2009, 2:23 pm
- Location: Tokyo, JPN
Re: Can I use a calc formula to change many values in a measure?
Basically, you need multiple formula for multiple condition. But you can put in conditional operator further into the true or false expression.
For example, it is assumed that you need the following 3 conditions.
(If the value is 0, -1 is returned. If the value is 10, -2 is returned. If the value is 20, -3 is returned. And if else, MeasureX is returned.)
For example, it is assumed that you need the following 3 conditions.
- ( MeasureX = 0 ? -1 : MeasureX )
- ( MeasureX = 10 ? -2 : MeasureX )
- ( MeasureX = 20 ? -3 : MeasureX )
(If the value is 0, -1 is returned. If the value is 10, -2 is returned. If the value is 20, -3 is returned. And if else, MeasureX is returned.)
- ( MeasureX = 0 ? -1 : ( MeasureX = 10 ? -2 : ( MeasureX = 20 ? -3 : MeasureX ) ) )
-
- Posts: 46
- Joined: January 29th, 2010, 3:39 pm
Re: Can I use a calc formula to change many values in a measure?
Nice!
Thanks a lot!
Thanks a lot!
-
- Posts: 46
- Joined: January 29th, 2010, 3:39 pm
Re: Can I use a calc formula to change many values in a measure?
Like this?
(MeasureX=0?350:(MeasureX=10?350:(MeasureX=20?-2:(MeasureX=30?-2:(MeasureX=40?-3:(MeasureX=50?-3:(MeasureX=60?-4:(MeasureX=70?-4:(MeasureX=80?-5:MeasureX)))))))))
Or I can add 1 more subset?
(MeasureX=0?350:(MeasureX=10?350:(MeasureX=20?-2:(MeasureX=30?-2:(MeasureX=40?-3:(MeasureX=50?-3:(MeasureX=60?-4:(MeasureX=70?-4:(MeasureX=80?-5:MeasureX)))))))))
Or I can add 1 more subset?
-
- Developer
- Posts: 263
- Joined: July 31st, 2009, 2:23 pm
- Location: Tokyo, JPN
Re: Can I use a calc formula to change many values in a measure?
You can add one more set. That's just a limit.
-
- Posts: 46
- Joined: January 29th, 2010, 3:39 pm