Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
vishalgoud
Creator III
Creator III

Need Help on Comparisions of Bar chart for Different Combinations b/w Year , month and Environment..?

Hi Experts ,

I have 3 main filters Environment , year and Month..

3 type of environemtns , 3 different years , and 12 months --- need to show the sales

1. if one Env , 1 year and 1 month selected then I have to show last 3 months of sales  including the selected month.

2. if one Env  , 1 year and more than one month selected then I have to show only selected months data.

3. if one Env , different years and same month selected then I have to show only selected months data based on the years selected.

4. if one Env , Different Years and different Months selected then I have to show only selected months data based on the years selected.

5. Different Env , same year , same month then show the data as per the filter selection...

6.

7.

8.

Etc Like this we will get several combinations , am trying to achive this by if condition but its came to know that its not the correct way to do. I think this can be achieved using set analysis....

Please provide your solution , and also please find the attachment for clear understanding...

already using set expression using month field to get the last 2 months of data.

Please respond with your solutions using set analysis.

Thanks in advance...

Best Regards,

V.

1 Reply
Not applicable

Seems to be only 1st requirement needs rolling 3 months calculation. rest are simple expression with out set analysis.

if( getselectedcount(Env)=1 and getselectedcount(Yr)=1 and getselectedcount(Mon)=1 ,

      sum(value) , // regular with out set analysis

      sum({<Mon={"<=$(=Max(Mon)>=$(=Max(Mon)-3)"}>}value)   // Set analysis make sure that use right date function to exact date format with Mon field

)