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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
jerryr125
Creator III
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
Creator III
Author

HI - The below works - thanks for your guidance:

 

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

View solution in original post

2 Replies
GaryGiles
Specialist
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
Creator III
Author

HI - The below works - thanks for your guidance:

 

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