Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
vannieariola
Contributor
Contributor

IF STATEMENT USING VARIABLES

Hello Experts

I am trouble with my IF Statement using as condition.

I have created 3 variables to be as measures.

  1. vPresenttax - this sum up the actual tax withheld
  2. vTaxDue -  this calculates for annual tax
  3. vstilldue_refund - this is the difference between vTaxDue - vPresenttax

What I am trying to achieve is to create a measure

  1. Still Due
  2. Refund

using if statement.

To  check if vstilldue_refund has value I created a measure called Still Due / Refund (Positive amount still due and negative amount Refund).  When I place the measure in my sheet its giving a positve value when vTaxdue is greater than vpresenttax, and negative value when vtaxdue is less than vpresenttax.

But when put it in another measure with if statement there is no result.

Measure Still Due =  if($(vstilldue_refund) > 0, $(vstilldue_refund),0) this giving no result.

Measure Refund =  if($(vstilldue_refund) <  0, $(vstilldue_refund)*-1,0) this giving no result.

Please help.

Thank you

9 Replies
Anil_Babu_Samineni

Can you describe more without Variables.

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
vannieariola
Contributor
Contributor
Author

Hi Anil,

vstilldue_refund= $(vtaxdue) - $(vpresenttax)

Measure

STILL DUE / (REFUND) = $(vstilldue_refund)

When I put this measure in my pivot table there is value. Meaning the variable is working fine.

Anil_Babu_Samineni

Image please for that without selection?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
vannieariola
Contributor
Contributor
Author

Hi Anil,

Here's the image you requested.

I appreciate your help.

Thank you.

pradosh_thakur
Master II
Master II

Hi Vannie

I tried something similar and that is working for me . Can you please just delete the label of the two column and hover the cursor on the top/header of the two column in the table. you can see the resulting expression can you please paste that screenshot please ?

Learning never stops.
Anil_Babu_Samineni

Are you working this in KPI/Text box?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
vannieariola
Contributor
Contributor
Author

2018-01-03_8-25-48.jpg

Anil_Babu_Samineni

Will u provide 2 different variables using measure?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
pradosh_thakur
Master II
Master II

Hi Vannie

what we meant is not in the edit mode. First delete the column headers/label for the column that value is not showing. then Click done . Then go and hover on the label of the column . something lime this.

Capture.PNG

Learning never stops.