Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
felipe_oliveira
Contributor III
Contributor III

Max week of current month/year selection

Hi masters

I have the filter below:

Filter.PNG

How can I find the amount of the last week of the max year and month selected?


In the example above, the latest selected month and year are October and 2017, thus the week should be 44, which is the last week of October 2017.


I have set the following variables:

vFieldYear = max([Year])

vFieldMonth = max([Month])

vFieldWeek = max(week($(=($(vFieldMonth)))))  <----- this one seems to be not working as expected


I have tried the following with no success:


=sum({<Year={$(=($(vFieldYear)))},Month={$(=($(vFieldMonth)))}, Week={$(=($(vFieldWeek)))}>}amt_to_finance)


=sum({<Week={$(=($(vFieldWeek)))}>}amt_to_finance)

Please help me

Thanks

Felipe Oliveira


1 Solution

Accepted Solutions
YoussefBelloum
Champion
Champion

=sum({<week={$(=max(Week(date)))}>}amt_to_finance )

View solution in original post

6 Replies
jpenuliar
Partner - Specialist III
Partner - Specialist III

Hi Felipe,

Do you have a a field containing dates(Daily) or a field derived by WeekName(Date)

WeekName(Date) as field_Week

then use Max(field_Week)

YoussefBelloum
Champion
Champion

Hi,

do you have your amt_to_finance measure per DATE or per week ?

felipe_oliveira
Contributor III
Contributor III
Author

I have both, date and week

antoniotiman
Master III
Master III

Why not

Week(Max(DateField))

YoussefBelloum
Champion
Champion

=sum({<week={$(=max(Week(date)))}>}amt_to_finance )

felipe_oliveira
Contributor III
Contributor III
Author

Thanks Youssef! You the man!