Skip to main content

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
QlikWorld 2023, a live, in-person thrill ride. Save $300 before February 6: REGISTER NOW!
cancel
Showing results for 
Search instead for 
Did you mean: 
jjustingkm
Creator
Creator

Group bar and Stack bar in the same graph

I have 6 measures against the X axis in a bar graph.

Is that possible for me to have two stacked bars in the graph , one with 3 measures and another also with 3 measures.

Or Can i have two dimensions in the graph . for example Region and Calendar Year, then have two measures. I see I can bring only one measure in this case.

 

Thanks,

5 Replies
joaopaulo_delco
Partner - Creator III
Partner - Creator III

Hi @jjustingkm !

              Yes, you can do it combining ValueList() fuction and set analisys.

joaopaulo_delco_0-1616443166432.png

See the app attached!!

 

 

Help users find answers! Don't forget to mark a solution that worked for you!
jjustingkm
Creator
Creator
Author

Thanks for looking into into it. The issue I have is there is one more dimension I need to add . For example, Country of Origin.

joaopaulo_delco
Partner - Creator III
Partner - Creator III

Hi @jjustingkm ! 

    If you have to add another dimension, you have to do it wit ValueList() function.

Help users find answers! Don't forget to mark a solution that worked for you!
jjustingkm
Creator
Creator
Author

If I understand it correctly, the value list function should add a dimension also.  But,  I don't see an option to add more than 2 dimensions in a graph. And also is it possible for you to paste the code here as I have some difficulty in opening the file.

joaopaulo_delco
Partner - Creator III
Partner - Creator III

Script:

[TAB1]:
Load * Inline [
Year, Region,  Measure1, Measure2, Measure3, Measure4, Measure5, Measure6
2017, North, 10, 20, 30, 40, 20, 30
2018, North, 5, 15, 30, 25, 30, 15
2019, South, 20, 30, 15, 30, 20, 15
2020, South, 30, 30, 20, 15, 30, 30
2021, East, 15, 20, 30, 10, 15, 25
];


Dimension:

=ValueList('Region','Calendar Year')

You can add as many dimension as you want.

Measures

// South
if(ValueList('Region','Calendar Year')='Region', Sum({<Region = {'South'}>}Measure1))

// North
if(ValueList('Region','Calendar Year')='Region', Sum({<Region = {'North'}>}Measure1))

// East
if(ValueList('Region','Calendar Year')='Region', Sum({<Region = {'East'}>}Measure1))

// 2018
if(ValueList('Region','Calendar Year')='Calendar Year', Sum({<Year = {'2018'}>}Measure1))

//2019
if(ValueList('Region','Calendar Year')='Calendar Year', Sum({<Year = {'2019'}>}Measure1))

//2020
if(ValueList('Region','Calendar Year')='Calendar Year', Sum({<Year = {'2020'}>}Measure1))

//2021
if(ValueList('Region','Calendar Year')='Calendar Year', Sum({<Year = {'2021'}>}Measure1))
Help users find answers! Don't forget to mark a solution that worked for you!