Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

IMPORTANT security patches for GeoAnalytics Server available to download: READ DETAILS
Showing results for 
Search instead for 
Did you mean: 

Set Analysis to find last possible day in week


I have a graph where I show product balances per week. In a week there can be multiple transaction but I am only interested in the last balance that was entered. This can be on Wednesday but also for example on Friday.


I have written the following formula: Sum(aggr(Max({<WeekDay = {$(=Max(WeekDay))}>} Balance), WeekYear, ProductID, LocationID)


This works, other then the fact that it fixes my WeekDay (this is a number 1-7 for Monday-Sunday). The problem is that is fixes it to 6 for example but not every week has a 6. What I need is that this day number needs to be changed per week to find the last day in that week and show the corresponding balance.

Hope you guys can help.


Best regards,


Labels (1)
2 Replies

I can think to generate the key using Autonumber() and use that field into measure

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)

How about this?

If(WeekDay = Max(TOTAL <WeekYear, ProductID, LocationID> WeekDay), Sum(Balance))
, WeekDay, WeekYear, ProductID, LocationID)