Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
petermoyaert
Contributor III
Contributor III

Calculating stock rotation

For calculating stock rotation, we want to take into account the sales of the last 12 months, which are not necessarily the sales of last year. So, when calculating stock rotation in april 2016, we want to take into account sales from april 2015-march 2016.

Anyone any suggestion on how to calculate this ?

Peter

2 Replies
Kushal_Chawda

Make sure that MonthYear field is calculated as MonthName(Date) as MonthYear

=Sum({<MonthYear ={">=$(=addmonths(max(MonthYear),-11))<=$(=max(MonthYear))"}>} Sales)

Gysbert_Wassenaar

For this you need either a date field or a serial numeric month field that increases by 1 for each month.

Using a date field it would be something like sum({<Year=,Month=,MyDate={">$(=Date(MonthStart(max(MyDate),-12)))<=$(=Date(MonthStart(max(MyDate))))"}>}sales)

If you have a month serial it would be something like sum({<Year=,Month=,_MonthSerial={">$(=max(_MonthSerial)-12)<=$(max(_MonthSerial))"}>}sales)


talk is cheap, supply exceeds demand