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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Ethel
Creator III
Creator III

set analysis for multiple years

Hello, I have a dashboard with several reports. I have a filter in my report, that shows years{2019,2020,2021,2022}. User can chose only one year. Also I have bar chart that shows data by years. For regular bar chart in measure I put 

Sum({<PeriodYear={2019,2020,2021}>}Total1) And in this case I have 4 bars for all 4 years. 

But for one report I had to create my own "fake" dimensions(value list).

For this particular report my formula in measure looks like this

if(valuelist('Women','Men')='Women' , Sum({<PeriodYear={2019,2020,2021,2022},Women={'Y'}>}Total1),Sum(PeriodYear={2019,2020,2021,2022},Men={'Y'}>}Total1))


In this case I see only one bar(instead of four) for the year that user choses. Why? What should I add to my formula to see all four years in my bar chart? Thanks a lot in advance!

Labels (6)
1 Solution

Accepted Solutions
rubenmarin
MVP
MVP

Hi, if you have a field to filter Men and Woman I think it will be easier to use that field.

Use a dimension like: =If(Women='Y','Women','Men')

With this the same inital expression should work: Sum({<PeriodYear={2019,2020,2021,2022}>}Total1)

 

View solution in original post

1 Reply
rubenmarin
MVP
MVP

Hi, if you have a field to filter Men and Woman I think it will be easier to use that field.

Use a dimension like: =If(Women='Y','Women','Men')

With this the same inital expression should work: Sum({<PeriodYear={2019,2020,2021,2022}>}Total1)