Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
rammarthi
Creator
Creator

Sliders and Set Analysis

I have a slider defining variables (vStrtDate and vEndDate) on a sale date ranging from 1-Jan-2013 to till date. I am using these variables on an aggregation (count) in a set analysis statement. I want only completed months data but not the current months data. If today is 15th May, I wanted data from 1st Jan 2013 to 31st May 2018 without using IF statement anywhere neither in defining variables or in expressions in frontend objects.

Only data of completed months should be taken into consideration.

Thank you.

Ram

1 Reply
jonathandienst
Partner - Champion III
Partner - Champion III

Do you have a calendar with months in your model?

Some ideas: set the upper limit of the vEndDate slider to the last month end date. That way the user can never select a date in the current (incomplete) month.

Or use RangeMin(vEndDate, vMaxCompleteMonths) where vMaxCompleteMonths is a variable that returns the last complete month. Define vMaxCompleteMonths something like this:

Set vMaxCompleteMonths = '=Date(Floor(MonthEnd(Max(Month, 2))))';

or

Set vMaxCompleteMonths = '=Date(Floor(MonthEnd(Max(Month). -1)))';

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein