Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How to do a rollback for the first 7 times/days in which I have Promotion ?
I use the following expression to calculate an average rolling back 7days
((Sum({<Promo ={1},DateTest={">=$(=Date(Today() - 9)) <$(=Date(Today()-2))"}>} [Prix de vente TTC]))/7)
My problem if the first 7 days I probably have Promotion or not for example , the resultas will be false ,
I need to do a rollback fo the first 7 days in wich promo = 1 (i have a promotion)? How to modify the expression ?
An example :
In the first example I should calculate CA in wihch promo = 1 and the first 7 days rolling back
26/02/2016 | 27/02/2016 | 28/02/2016 | 29/02/2016 | 01/03/2016 |
20/02/2016 | 21/02/2016 |
Maybe like this:
sum({<DateTest={'>=$(=FirstSortedValue({<Promo={1},Date={'<=$(=Today()-2)'}>} Date,-Date, 7))<=$(=Today()-2)'}>}[Prix de vente TCC])
If not, then please post a small qlikview document that illustrates the problem.
I attach an example many thanks
Try this expression:
=sum({<promo={1},WeekDate= {">=$(=Date(Max({<WeekDate={'<=$(=Date(max(WeekDate)-2))'}, promo={1}>} WeekDate,7)))<=$(=date(max(WeekDate)-2))"} >}SoldAmt)