Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Conditional Expression

Hi everyone!

I have this table:

   

Order noS_QA_Q
A100125
B200199
C300280
D4000
E0500
F600400
G550550

I would like to show the difference between S_Q and A_Q that greater than 5% or less than -5%, the answer should be like these:

    

Order noS_QA_QDiff%diff
A1001252520%
C300280-20-7%
E0500500100%
F600400-200-50%

what is the expression?

12 Replies
sunny_talwar

Try this

Dimension

Order no

Expressions

If(fabs((A_Q - S_Q)/A_Q) > 0.05, (A_Q - S_Q))

If(fabs((A_Q - S_Q)/A_Q) > 0.05, (A_Q - S_Q)/A_Q)

Basically, you need to restrict your other expressions to not show value when the percentage is less than 5% or greater than -5%...

Anonymous
Not applicable
Author

Is it right to add calculation dimension like this? (A_Q - S_Q)

why in siome cases I get this error:

// Error in calculated dimension
sunny_talwar

You can do that too...

Dimension

=Aggr(If(fabs((A_Q - S_Q)/A_Q) > 0.05, [Order no]), [Order no])

Expression

(A_Q - S_Q)

(A_Q - S_Q)/A_Q


Capture.PNG