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

Announcements
Posting on Qlik Community is temporarily paused. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
daisy
Contributor
Contributor

Percentage in stack bar with MTD & YTD Dimension

Hello Everyone:

I have a 2 Financial Year data pool like below:( DR Result only have 4 figures :1,2,3,4)

NoPGI DateFinancial YearPeriodDR Result
110/31/2019FY20P11
29/26/2020FY20P122
310/15/2020FY21P11
411/10/2020FY21P23
512/9/2020FY21P32
612/29/2020FY21P34

 

I want to create a percentage stack bar with MTD & YTD Dimension like below:

example1.png

Current Situation:

Now I use valuelist as the dimension, but it's vvvvvvery complex!

Dimension: =ValueList('FY20','P1','P2','P3','P4','P5','P6','P7','P8','P9','P10','P11','P12','FY21')

Measure: there's 4 measures all use pick(match(valuelist()),,count({<DR Result={'1'}>})/count()), which will write a lot of rows!!!

My Target:

I read a post : https://community.qlik.com/t5/Qlik-Sense-App-Development/Percentage-display-on-a-Stacked-Bar-Chart/t... , so I try to revise my function, but I only can write MTD, without YTD

Dimension1: Period

Dimension2: DR Result

Measure: count({<FY={'FY21'}>}[DR Result])/sum(total <Period> aggr(count({<FY={'FY21'}>}[DR Result]),Period,[DR Result]))

example2.png

 

So my question is that is there a way to make it easier to show the percentage stack bar with MTD & YTD in the dimension?

Thanks so much in advance!

0 Replies