Skip to main content
Announcements
Customer Spotlight: Discover what’s possible with embedded analytics Oct. 16 at 10:00 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

If statement?!?

I've my data like following

Cust IDCategoryValue
130
23575
399
430250
535

I need help with the statement.

In my report I want to present the following.

If category = 30  then present Value as 150 000

If category is <>30 then present Value as 0

If value has a number then present that number times 1000 (x1000). This last one shall overrule the previous statements.

I'm not sure if it's best to do it in the loadscript and load it into colum "newValue" or if I should to it in the expression.

1 Solution

Accepted Solutions
Not applicable
Author

I solved it by using

=If(Value>0, sum(Value*1000),(If(Category=30, 150000, 0)))

View solution in original post

3 Replies
MarcoWedel

Alt(Value*1000, -150000*(Category=30))

Anonymous
Not applicable
Author

Hi,

You'd better calculate a field NewValue in the script.

Use the following script:

If(Isnull(Value)=-1,

If(Category=30, 150000,0),

1000*Value) as NewValue

Otherwise if you want to use it in a graph directly, just use the following as the expression with Value and Category as dimension:

If(Isnull(Value)=-1,

If(Category=30, 150000,0),

1000*Value)

Not applicable
Author

I solved it by using

=If(Value>0, sum(Value*1000),(If(Category=30, 150000, 0)))