Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello community,
I am facing an issue with sorting stacked bars in Qlik Sense. I would appreciate any guidance or suggestion. Each bar represents a year, and within each bar, there are segments that represent different values. The bars and their segments are not sorting as expected.
I have used the expression bellow for the measure "PDM":
if( GetSelectedCount([subCategory])=0 and GetSelectedCount([Category])=0 ,
Sum({$<year = {">=$(=max(year)-3)<=$(=max(year))"}, Source = {'SRC'}, Category=p(Category), [subCategory]=p([subCategory])>} Amount)
/
Sum({1<year = {">=$(=max(year)-3)<=$(=max(year))"}, Source = {'SRC'}>} total <year> Amount)
,
if ( GetSelectedCount([Category])>0 and GetSelectedCount([subCategory])=0 ,
Sum({$<year = {">=$(=max(year)-3)<=$(=max(year))"}, Source = {'SRC'}, Category=p(Category)>} Amount)
/
Sum({1<year = {">=$(=max(year)-3)<=$(=max(year))"}, Source = {'SRC'},Category=p(Category)>} total <year> Amount)
,
Sum({$<year = {">=$(=max(year)-3)<=$(=max(year))"}, Source = {'SRC'}, Category=p(Category), [subCategory]=p([subCategory])>} Amount)
/
Sum({1<year = {">=$(=max(year)-3)<=$(=max(year))"}, Source = {'SRC'},Category=p(Category), [subCategory]=p([subCategory])>} total <year> Amount)
))
The data visualized on the stacked bar chart looks like this:
I need to sort the segments (here company) for each year while maintaining a fixed color code for each company.
Try creating a master Dimension
Then go to the edit dimension property and click on VALUE COLOURS option
Here you can try to put colors based on your requirements for the company. Further call this dimension name in the Dimension section. you will see custom colors for the company.
tried sorting via below sort option but seems its not happening. :S
@kaushi2020 Thanks for the help about the dimension color. As u can see, the sorting still doesn't work
May be some issues with the version which we are using. I am also awaiting for experts to revert on the sorting. Seems this is unusual behaviour.
#Support