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: 
MK_QSL
MVP
MVP

Variables

What is the difference between below two expressions we used while declaring any variable?

Variable Name

vMaxInvYear01

Variable Value

=Year(Max([Invoice Date]))

Variable Name

vMaxInvYear02

Variable Value

Year(Max([Invoice Date]))

Now if I want to sum qty how can I achieve using both of the above variables?

SUM({<Year = 1st Variable>}QTY)

SUM({<Year = 2nd Variable>}QTY)


If possible, please explain with a good example....!!!

3 Replies
CELAMBARASAN
Partner - Champion
Partner - Champion

First variable can be used as

SUM({<Year = {$(vMaxInvYear01)}>}QTY)

Whereas second variable can be used as

SUM({<Year = {$(=vMaxInvYear01)}>}QTY)

bbi_mba_76
Partner - Specialist
Partner - Specialist

Hi,

SUM({<Year = {"=$(=vMaxInvYear01)"} >}QTY)

SUM({<Year = {"=$(=vMaxInvYear02)"} >}QTY)

israrkhan
Specialist II
Specialist II

both variable having same value max year from your Year Field.

if you have selected three years in Year List like 2006, 2007, 2008, then the variable will have 2008,

if u did not make selection in Year Field then it will have last year from your Year list, might be 2013.

try like below:

=SUM({<Year = {$(=vMaxInvYear01)}>} QTY)