Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Aditya_Chitale
Specialist
Specialist

Custom month set analysis for pre and post period display

Hi All,

I want to show pre and post 3 months data for a selected month in line chart. eg if selected month=Jan 2019, pre period will be Oct 2018, Nov 2018, Dec 2018 and post period will be Feb 2019, Mar 2019, Apr 2019. 

My issue here was, if I select multiple non consecutive months. eg Jan 2019, Feb 2019 and Aug 2019, then I am able to write set analysis on min and max selected months for showing pre and post period. but my current period is showing all months from Jan 2019 till Aug 2019. 

I want to show just the selected months for current period. Any help would be appreciated.

Currently used set analysis expression:

sum({$<[DATE]={">=$(=Date(monthstart(addmonths(min([Training start date]),-3))))<=$(=Date(Monthend(addmonths(max([Training start date]),3))))"}, [Training start Month]=>}[Amount])

Regards,

Aditya

Labels (1)
  • SaaS

1 Solution

Accepted Solutions
vinieme12
Champion III
Champion III

you cannot have one expression do both jobs

1) one expression for prev 3 and post 3 months

2)another expression for current selected period

 

You would need to do an if() block

=if(getselectedcount(yearmonth)>1   // check if more than one yearmonth is selected

, expression for current period

,expression for pre 3 and post 3 months )

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

1 Reply
vinieme12
Champion III
Champion III

you cannot have one expression do both jobs

1) one expression for prev 3 and post 3 months

2)another expression for current selected period

 

You would need to do an if() block

=if(getselectedcount(yearmonth)>1   // check if more than one yearmonth is selected

, expression for current period

,expression for pre 3 and post 3 months )

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.