Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
saminouari
Contributor III
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 (2)
1 Solution

Accepted Solutions
saminouari
Contributor III
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
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
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)