Skip to main content

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Action-Packed Learning Awaits! QlikWorld 2023. April 17 - 20 in Las Vegas: REGISTER NOW
Showing results for 
Search instead for 
Did you mean: 
Contributor III
Contributor III

I want to Add Max Year to My set Analysis

Hi Guys,


Coming into 2020 i Want to add in Max year to my Set analysis Function. At the Moment I only have 2019 data.

The Below Function gives me the Last 8 Weeks Of tasks. How do i add in Max year so when we step into 2020 It will display last 8 weeks Accordingly?

sum({<DailyTaskType = {'Counts'}, Week = {">=$(=Max(Week)-8)<$(=Max(Week))"}>}EstimatedTaskTime*Tasks)


Thanking You in Advance.

Labels (1)
3 Replies

Perhaps this

sum({<DailyTaskType = {'Counts'}, Year={"$(=Max(Year))"}, Week = {">=$(=Max(Week)-8)<$(=Max(Week))"}>}EstimatedTaskTime*Tasks)


sum({<DailyTaskType = {'Counts'}, Week = {">=$(=Max({<Year={"$(=Max(Year))"}>} Week)-8)<$(=Max({<Year={"$(=Max(Year))"}>} Week))"}>}EstimatedTaskTime*Tasks)

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)

Does your week field contain information for the year? for example 201953, 201952 or it is just 53, 52, 51 etc?

Contributor III
Contributor III

You can not use Script Functions within the Set Analysis.

To be able to use the Maxfunction you will need to put it in a Variable:

e.g. vMaxYear=Max(Year)

then put the Variable in the Set Analysis: