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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to write set analysis for display current year

Hi,

I am using Qlik Sense and want to use set analysis to display Current Year and Previous year. I already try a few expression but not working to me. Can anyone help me ?

I have field name Order Date and sales in this case

Here is a few expression that I try :

SUM({$<Year={$(=MAX(Year))}>}Sales)

SUM(${<Year={"$(=Year(Today()))"}>}Sales)

Thank You

Nurul

2 Replies
sunny_talwar

How are you creating Year field in the script? Like this

Year(OrderDate) as Year? If it is like this... then this looks right to me

SUM({$<Year={$(=MAX(Year))}>}Sales)

or

SUM({$<Year={$(=Year(Today()))}>}Sales)

isaiasdd
Creator
Creator

You can use:

Year(today()) // show the current year

Year(today())-1 // show the previous year based on current year

In yours expressions:

SUM({$<Year={'$(=Year(Today()))'}>} Sales)   // sales for current Year

SUM({$<Year={'$(=Year(Today())-1)'}>} Sales) // sales for previous Year