Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Dayna
Creator II
Creator II

Calculation to get the last x weeks stock

Hello,

With the help from the guys on here, I have a chart that shows the forecasted and actual sales for the last 13 weeks and next 13 weeks.

I am trying to add a line to show the levels of stock at the time of these dates. The record I have shows the stock level for today, to get the stock level for yesterday you have to subtract the sum of the transactions for yesterday, and so on for 91 days to get the last 13 weeks. (to be shown on a week basis).

Ive tried this:

if(weekstart(today())-makeweekdate(FCS_Year,FCS_Week)<=91 AND weekstart(today())-makeweekdate(FCS_Year,FCS_Week)>=0, sum( {$<FCS_YearWeek = {$(vYesterday)}>} in_qty_oh_m - tr_qty_chg))

With the variable holding:



=((

vToday)-0.01)

If someone could please help me fix this, it would be really appreciated!

Kind Regards,
Dayna





0 Replies