Skip to main content
Announcements
Qlik Launches Open Lakehouse and advanced agentic AI experience in Qlik Answers! | LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
jerryr125
Creator III

Subtract two variables

Hi - I have the following two variables created :

 

vACT

IF([FINANCEACTBDGYEAR]=$(vBudget_current_year),IF([FINANCEACTBDGMONTH]=$(vBudget_current_month_num),NUM([ACTUALAMOUNT],'0')))

** Works Perfect

 

vBDGT

 

IF([FINANCEACTBDGYEAR]=$(vBudget_current_year),IF([FINANCEACTBDGMONTH]=$(vBudget_current_month_num),NUM([BUDGETAMOUNT],'0')))

** Works Perfect

 

I created a new variable (the variance of the two)

vACTBUDVAR

=SUM((vACT)-(vBDGT))

 

does not work - results in zero - any thoughts ?

1 Solution

Accepted Solutions
jerryr125
Creator III
Author

HI - The below works - thanks for your guidance:

 

=SUM(($(=vBDGT)))-SUM(($(=vACT)))

View solution in original post

2 Replies
GaryGiles
Specialist

I think you need to add the $() expansion:

=SUM(($(vACT))-($(vBDGT)))

You may need to add an = sign to your 2 variables or the within the $():

=SUM(($(=vACT))-($(=vBDGT)))

jerryr125
Creator III
Author

HI - The below works - thanks for your guidance:

 

=SUM(($(=vBDGT)))-SUM(($(=vACT)))