Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
pauldamen
Partner - Creator II
Partner - Creator II

Set Analysis to find last possible day in week

All,

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,

Paul

Labels (1)
2 Replies
Anil_Babu_Samineni

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

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

How about this?

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