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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
ajsjoshua
Specialist
Specialist

Last WTD

Hi all

i have two calendars upload calendar and forecast calendar,

each upload week(Week_UP) has 12 forecast week(week)

Each Id has lockperiods ,i want to calculate the  order from the maximum upload week which has 12 months based on lockperiod.

EX:if upload week is 1 and the id has lockperiod 4 i want to see the orders for week(forecast week)=5

I am using this formula

=Sum({<Year_UP={$(=Max(Year_UP))},MonthID_UP= {$(=Max(MonthID_UP))},Week_UP= {$(=Max(Week_UP))},Year_UP=,Week_UP=>} Aggr(If(Only({1}Week) = Max(TOTAL <ID>  Week_UP ) + Only(TOTAL <ID>  LockPeriod)  ,

Sum({<Year_UP={$(=Max(Year_UP))},MonthID_UP= {$(=Max(MonthID_UP))},Week_UP= {$(=Max(Week_UP))},Year_UP=,Week_UP=>}Orders)), ID, Week ))

now i want to calculate the orders for previous week

i tried this its not working

=Sum({<Year_UP={$(=Max(Year_UP))},MonthID_UP= {$(=Max(MonthID_UP))},Week_UP= {$(=Max(Week_UP)-1)},Year_UP=,Week_UP=>} Aggr(If(Only({1}Week) = Max(TOTAL <ID>  Week_UP-1 ) + Only(TOTAL <ID>  LockPeriod)  ,

Sum({<Year_UP={$(=Max(Year_UP))},MonthID_UP= {$(=Max(MonthID_UP))},Week_UP= {$(=Max(Week_UP)-1)},Year_UP=,Week_UP=>}Orders)), ID, Week ))

Labels (1)
1 Reply
Digvijay_Singh
MVP
MVP

Can you share sample data to recreate the prob, I could see expressions are exactly matching with the only difference is in calculating previous week via Week_UP-1.

It seems If condition needs to be verified but not sure, can understand better from sample data.