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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Comparing variable to Month in expression

Hi Guys,

I'm trying to use set analysis to calculate M2D & Y2D values for some measure which should remain constant irrespective of other selections.

I'm storing the current Month, Year in separate variables defined as vYear = Year(Today()).

I have a separate field from my database which is called 'Year'.

Now, my set analysis expression looks like :

Sum({1<[Year]={'$(vYear)'}>}OOS)

However, this returns no results whereas if I output the values through KPI indicators, they both say '2018'.

If I change my variable from the function to just '2018', this works fine.

My first thought is that there is a datatype mismatch - which I have no idea how to handle in QS.

Would you be able to point what the issue is?

2 Replies
juraj_misina
Partner Ambassador Affiliate
Partner Ambassador Affiliate

Hi,

is your vYear variable defined with leading equal sign?

Juraj

agigliotti
MVP
MVP

let's try as below:

Sum( {1< Year = {"$(=(vYear))"} >} OOS )

hope it helps.

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it