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: 
KPage
Contributor III
Contributor III

Current Week

I am trying to get the correct expression to set MaxWeek as a variable. The 2 formulas below have both worked, but then some days (even within hours), I do not get an answer. Seems very random. Would there be a reason as to why sometimes this expression works, and sometimes it doesn't? Week Ending for example 4/30/2023

 

=date(Max(GetFieldSelections(Date)))

=Date(Max(GetFieldSelections(Date)))

Labels (3)
2 Replies
Digvijay_Singh

I think it would only work if your selection has a single date, if multiple values are selected, then the expression might be incorrect, something like this Max(01/01/2009, 02/01/2009).

Not sure if you want to get the current week number like this - Week(Max(Date))

You may want to check relevant function over here - 

https://help.qlik.com/en-US/sense/February2023/Subsystems/Hub/Content/Sense_Hub/Scripting/DateAndTim...

 

MarcoWedel

to only use the selected Date values, you could try with something like

 

=Date(Max({1<Date=$::Date>} Date))

or

=WeekName(Max({1<Date=$::Date>} Date))

or

=Week(Max({1<Date=$::Date>} Date))

depending on your requirement regarding the MaxWeek calculation