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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
kmmqlick
Contributor III
Contributor III

100% Bar Chart Issue

Hi All,

I am facing a problem with 100% Stacked bar chart .I have category filter, when i select  particular category i want to change years(example Cateogory-A only years need to show is 2019-2022 and Category-B only 2020-2023).Please help me to solve this problem.Question.jpg

 

Labels (1)
1 Solution

Accepted Solutions
Kushal_Chawda

@kmmqlick  try below

=if(getfieldseletions([Category]='Category-A',

sum({<Year ={">=$(=min(Year))<=$(=max(Year)-1)"}>}Sales)/sum(total <Year>{<Year ={">=$(=min(Year))<=$(=max(Year)-1)"}>}Sales),

if(getfieldseletions([Category]='Category-B',

sum({<Year ={">=$(=min(Year)-1)<=$(=max(Year))"}>}Sales)/sum(total <Year>{<Year ={">=$(=min(Year)-1)<=$(=max(Year))"}>}Sales),

sum(Sales)/sum(total <Year>Sales)))

View solution in original post

1 Reply
Kushal_Chawda

@kmmqlick  try below

=if(getfieldseletions([Category]='Category-A',

sum({<Year ={">=$(=min(Year))<=$(=max(Year)-1)"}>}Sales)/sum(total <Year>{<Year ={">=$(=min(Year))<=$(=max(Year)-1)"}>}Sales),

if(getfieldseletions([Category]='Category-B',

sum({<Year ={">=$(=min(Year)-1)<=$(=max(Year))"}>}Sales)/sum(total <Year>{<Year ={">=$(=min(Year)-1)<=$(=max(Year))"}>}Sales),

sum(Sales)/sum(total <Year>Sales)))