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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Problem with max in set analysis - week value

I have a chart that has the dimension weeks in a month (Week1, Week2, Week3 and Week4), need to get the last value that occurred each week, for that I am using the function below in the script:

num (WeekDay (Table.Date)) + 1 the WeekDay,

In one case I have the following scenario:

Week 1 - Last Occurrence: Sixth day of the week

Week 2 - Last Occurrence: Seventh day of the week

Week 3 - Last Occurrence: Seventh day of the week

Week 4 - Last Occurrence: Fifth day of the week

When I do the following formula in the chart:

Sum({<Table.WeekDay= {$(=Max(Tabe.WeekDay))}>} Table.Value)

By doing this only the values ​​of weeks two and three appears, for these contain values ​​on the seventh day of the week, I need to make it appear weeks 1 and 4, with the values ​​of the sixth and fifth day, respectively, does anyone know how to do this set analysis or otherwise?

Thank you.

4 Replies
Josh_Good
Employee
Employee

I think you need to have QlikView evaluate each week separately because the last day of the week is different.  Try using Aggr across each week.

Something like this:

Sum(Aggr(Sum({<Table.WeekDay= {$(=Max(Tabe.WeekDay))}>} Table.Value),WeekofMonth))

Not applicable
Author

Still show only the week 2 and 3 with Aggr...

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

If you have only one value per day you can try this: firstsortedvalue(Table.Value,-Table.Weekday)


talk is cheap, supply exceeds demand
Not applicable
Author

no value appears with this function