Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
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!

4 Replies
Not applicable
Author

Hello Monica

You can use something like this:

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

Hope it helps.

Regards

Diego

ahaahaaha
Partner - Master
Partner - Master

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.

Regards,

Andrey

shraddha_g
Partner - Master III
Partner - Master III

Create a Date, YearStart from MonthYear Field.

In Set Analysis you can use

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

Not applicable
Author

Diego,

This worked, thank you for your help!