Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

Year to date expression?

Hi, I am new to Qlik sense, and need some help. I have a "MonthYear" field which has months and years data and need to create a set expression that will only sum the data for the current year. Any help is much appreciate. thank you!

Tags (2)
4 Replies
Not applicable

Re: Year to date expression?

Hello Monica

You can use something like this:

sum ( if ( year (MONTHYEAR_FIELD) = year ( today ( ) ) , SUM_WANTSUM ) )

Hope it helps.



Honored Contributor

Re: Year to date expression?

Hi Monica,

In my opinion the best would be to create together with the field MonthYear and field Year, when you create Master Calendar. Further field Year can be used as dimension in charts and in filters. It's easier than every time creating Set Analisys expression  in charts the based on MonthYear dimension.




Re: Year to date expression?

Create a Date, YearStart from MonthYear Field.

In Set Analysis you can use

Date = {">=$(=date(max(YearStart)))<=$(=date(max(Date)))"}

Not applicable

Re: Year to date expression?


This worked, thank you for your help!