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

Announcements
Talend Cloud AWS EU Scheduled Outage: Starting Tues 26 May 21:00 CEST with expected completion Wed 27 May 01:00 CEST
cancel
Showing results for 
Search instead for 
Did you mean: 
jamiemcc
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
Anil_Babu_Samineni

Perhaps this

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

Or

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

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sunny_talwar

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

H_Julian
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:

sum({<Date={$(vMaxYear)}>}

 

Greetings