Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
yousra_badra
Contributor II
Contributor II

Create a multi dimensional Bar chart

I want to create a simple stacked bar chart like the attached.  each bar in the x-axis is a separate dimension and has to be stacked. is there a way to group multiple dimensions in one dimension to create this graph?

 

Thank in advance 🙂 

 
 
 

 

 

 

Labels (1)
3 Replies
Gui_Approbato
Creator III
Creator III

Hi Yousra,

I don't know what your columns are, but try to follow this example:

First I made a stacked bar chart (just adjusted the option to make it stacked):

The dimensions were "Estado" (State name), "Cultivo" (Crop name) and the measure was Sum(Área).

Stacked bar chart 1.png

Then, to divide it by the total of each State (Estado) I had to change the measure to this:

Sum(Area)/Sum(Total <Estado> Area)

With this expression the calculation is based on the total of each Estado:

Stacked bar chart 2.PNG

 

I hope it helps.

Cheers

yousra_badra
Contributor II
Contributor II
Author

Thank you for your reply.  my problem is the dimension as each bar is a separate dimension. TD, PP, BP and so on. how can I group them all in one chart?

 

Thanks in advance 

Gui_Approbato
Creator III
Creator III

Ah, I see..

In this case you need to use the 'Crosstable' in the script editor.

With the crosstable function you will 'unpivot' the columns and transform them in one column.

https://help.qlik.com/en-US/sense/February2020/Subsystems/Hub/Content/Sense_Hub/Scripting/ScriptPref...