Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
saminouari
Contributor III

Previous Month actual Year

Hi,

I want to get the sales of previous month, and the formula gives me the month of last year  (november 2019), and what I want is the previous month of actual year (january 2020).

Formula : count({$<Month={"$(=max(Month)-1)"}, PDV_ModelName={'Available on EXIT'},PDV_Boolean={1},StoreDisabled={0}>} ProductId&StoreId)

last.PNG

 

 

Labels (1)
1 Solution

Accepted Solutions
saminouari
Contributor III
Author

It dosent' works, but I did find a solution.

count({<VisitDate={">=$(=MonthStart(Max(VisitDate),-1)) <=$(=MonthEnd(Max(VisitDate),-1))"},
PDV_ModelName={'Available on EXIT'},PDV_Boolean={1},StoreDisabled={0}, Month=>} ProductId&StoreId)

View solution in original post

2 Replies
kaushiknsolanki
Partner Ambassador/MVP

Try this,

count({$<Month={"$(=max({<Year = {"$(=Max(Year))"}>}Month)-1)"}, PDV_ModelName={'Available on EXIT'},PDV_Boolean={1},StoreDisabled={0}>} ProductId&StoreId)

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
saminouari
Contributor III
Author

It dosent' works, but I did find a solution.

count({<VisitDate={">=$(=MonthStart(Max(VisitDate),-1)) <=$(=MonthEnd(Max(VisitDate),-1))"},
PDV_ModelName={'Available on EXIT'},PDV_Boolean={1},StoreDisabled={0}, Month=>} ProductId&StoreId)