Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Need help with a nested if statement for a Dimension

Actually, this is for a straight table, and not sure if it should be a dimension or an expression, but I guess I can figure that out on my own. What I can't figure out, is how to create an if statement to populate a value for in the (Result) column.

The columns I am evaluating are:

Flag

Excess

Allowance

Fees

And the logic I am trying to implement goes like this:

IF Flag = 'x'

     THEN Excess = Allowance

IF Flag = ''

     IF Allowance > Fees THEN Allowance - Fees

     IF Allowance < Fees THEN 0

Many thanks!

Labels (1)
1 Solution

Accepted Solutions
Not applicable
Author

David,

Try this

Excess = if(flag='X',Allowance,if(Allowance > Fees,Allowance-Fees,if(Allowance<Fees,0)))

-Ram

View solution in original post

2 Replies
Not applicable
Author

David,

Try this

Excess = if(flag='X',Allowance,if(Allowance > Fees,Allowance-Fees,if(Allowance<Fees,0)))

-Ram

Not applicable
Author

Damn... you make it look so easy with so little code...

Many thanks!!