Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

gadamo88
New Contributor II

Set Analysis with variables

Hi,

I'm new to the community!    I have a problem, I could not fix it

I want to see the sum of the budget amount accumulated up to the current month, to try to solve, I have created two variables, one stores the current year (vAñoActual) and the other stores the current month (vMesActual)

the next line does not do the required calculation

Sum( {<Año={$(vAñoactual)}> - < Mes={">"$(vMesActual)""}>  } MontoPtto)


the next line does the calculation, but it is not correct, it does not exclude the indicated values

Sum( {<Año={$(vAñoactual)}> - < Mes={">$(vMesActual)"}>  } MontoPtto)


to make it work, put the month in number
Sum( {<Año={$(vAñoactual)}> - < Mes={">8"}>  } MontoPtto)

What I want is to replace that 8 with a variable, as I did in the case of the current year.

Attached example app

Help me, please!!

1 Solution

Accepted Solutions
MVP
MVP

Re: Set Analysis with variables

Try this

Sum({<Año = {$(vAñoactual)}, Mes = {"$(='<=' & $(vMesActual))"}>} MontoPtto)

Where vMesActual is Num(Month(Today()))

3 Replies
MVP
MVP

Re: Set Analysis with variables

Try this

Sum({<Año = {$(vAñoactual)}, Mes = {"$(='<=' & $(vMesActual))"}>} MontoPtto)

Where vMesActual is Num(Month(Today()))

gadamo88
New Contributor II

Re: Set Analysis  with variables

excellent, it's working

thank you very much 

gadamo88
New Contributor II

Re: Set Analysis with variables

excellent, it's working

thank you very much