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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Monitoring No Sales Events

I would like to look back 3 months for no sale activity on a given sale item that sold in the current month  . This  would allow me to flag it as a A new sale. In the example I've attached  sample of a pivot table I am working with Item LEM 24L would qualify as a new sale since 3 months prior  May Jun and Jul there was no sales. . I have tried  creating LastThreeMonthFlag but it does not seem to work see script. Any assistance would be appreciated.

2 Replies
Not applicable
Author

Something like below. Note: You might need to use a date field and do Monthname(Datefield) to order your months correctly for this to work.

if(rangesum(Before(sum(distinct UnitSold),1,3))=0, sum(distinct UnitSold))

Anonymous
Not applicable
Author

Hi Marcsliving

As suggested I used a correctly sorted monthyear ( datefield) and it worked beautifully exactly what I was looking for .

Thanks so much

Regards

Mike