Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How to do a rollback for the first 28 times/days in which Promo ={0} ?
I use the following expression to calculate an average rolling back 28 days
((Sum({<Promo ={0},DateTest={">=$(=Date(Today() - 30)) <$(=Date(Today()-2))"}>} [Prix de vente TTC]))/28 )
My problem if the first 28 days Promo <> {0} for example , the resultas will be false ?
May be this:
If(Promo = 0, ((Sum({<Promo ={0},DateTest={">=$(=Date(Today() - 30)) <$(=Date(Today()-2))"}>} [Prix de vente TTC]))/28))
Date(Today() - 30) is the problem , the value 30 should be dynamically changed . In case in rolling back 60 days I will get 28 days in which Promo= {0} so my expression will be
((Sum({<Promo ={0},DateTest={">=$(=Date(Today() - 60)) <$(=Date(Today()-2))"}>} [Prix de vente TTC]))/48 )
Would you be able to share some sample data to see what you are trying to do? It is rather difficult to understand what you are trying to do, just by looking at your expression.