Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
okanakdemirci
New Contributor

Help For Sum Function (Set Analyses)

     On the filter screen, when 2017 and 2018 is selected, I can see all available months for selection. However, while doing the calculations, I want to use the months of 2018 only. For instance, when I execute this code, the biggest year 2018 can be selected as well as the biggest month the 12th can be selected whereas there is no 12th month available for 2018 in my dataset, due to this it doesn't work properly. What I want is, when I select a year, months should be filtered out based on the selected month and calculations should be done accordingly.

Sum({$<Year={"$(=(Max(Year)))"}, Month={"$(=(Max(Month)))"}>} Envanter)

I tried this but doesnt work

Sum({$<Year={"$(=(Max(Year)))"}> * $<Month={"$(=(Max(Month)))"}>} Envanter)

Picture.png

4 Replies
MVP
MVP

Re: Help For Sum Function (Set Analyses)

Ideally, in this scenario you should use date field instead, like:

Sum({$<Year, Month, Date={">=$(=MonthStart(Max(Date))) <=$(=MonthEnd(Max(Date)))"}>} Envanter)

Re: Help For Sum Function (Set Analyses)

Try this

Sum({$<Year = {"$(=Max(Year))"}, Month = {"$(=Max({<Year = {'$(=Max(Year))'}>}Month))"}>} Envanter)

okanakdemirci
New Contributor

Re: Help For Sum Function (Set Analyses)

Thank You so much , its work

Re: Help For Sum Function (Set Analyses)

Great, we are glad that we were able to help