Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Our next Qlik Insider session will cover new key capabilities. Join us August 11th REGISTER TODAY
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
Luminary Alumni
Luminary Alumni

Try this,

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

Regards,
Kaushik
If reply is satisfactory, please "Like" the post.
If reply is solution, please mark as "Correct".
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