Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Current Year value for a particular variable value

Hi All,

I have requirement where I need to find out current year sales.Looks below expression is good for current year.

Sum({<Year = {'$(=Year(Today()))'}>}Sales)

But my requirement is i want to find out the current year sales based Variable value.

for example:

my Variable is "vIndicator",this variablewill store the values like A,B,C.

I want to find the current year sales where variable :vIndicator" value is 'A'

Sum({<Year = {'$(=Year(Today()))'}>,sum(if($(Indicator)='A')Sales)??

Any suggestions ?

Thanks

11 Replies
sasikanth
Master
Master

Try some thing like this

create a condion like this

vVar=if($(vIndicator)='A',max(Year)/Year(today())

sum({Year={'$(vVar)'}>}sales)

or else

use all the conditions like below

sum({<[Suspension Flag - MM]={'*'}-{'#'}, Year={$(=vCurrentYear)}>}sales

in the above expression use all the conditons those are equal to 'A'

Not applicable
Author

Sasi, Looks your solution not working .

finally I got it here below the expression.

sum(if(Year=$(vCurrentYear),if($(vIndicator)='3. Due Later',[Undelivered Net value USD])))

Thanks to all for your valuable suggestions.