Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

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

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

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)
sunny_talwar

How about this?

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