Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Announcements
BARC’s The BI Survey 19 makes it official. BI users love Qlik. GET REPORT
timbatman
New Contributor

Combined Stacked and Grouped Bar Chart

I have four variables of interest:

Q1CompCost, Q1WaterCost, Q2CompCost, Q2WaterCost

I wanted a stacked bar chart by quarter, but I can seem to only get all 4 variables to stack or all 4 to be side by side.  Any ideas?

Labels (2)
1 Solution

Accepted Solutions
Claudiu_Anghelescu
Valued Contributor

Re: Combined Stacked and Grouped Bar Chart

if not works you can try also this:

 

Dimension:

=valuelist('Q1', 'Q2') 

 

Expression Q1:

=if(valuelist('Q1', 'Q2') ='Q1',
sum(Q1CompCost))

Expression Q1:

=if(valuelist('Q1', 'Q2') ='Q1',
sum(Q1WaterCost))

 

Expression Q2:

=if(valuelist('Q1', 'Q2') ='Q2',
sum(Q2CompCost))

Expression Q2:

=if(valuelist('Q1', 'Q2') ='Q12,
sum(Q2WaterCost))

 

...and use the same color for each measure.

To help community find solutions, please don't forget to mark as correct.

View solution in original post

3 Replies
Claudiu_Anghelescu
Valued Contributor

Re: Combined Stacked and Grouped Bar Chart

Dimension1:

=valuelist('Q1CompCost', 'Q1WaterCost') 

 

Dimension2:

=valuelist('Q2CompCost', 'Q2WaterCost')

 

Expression Q1:

=if(valuelist('Q1CompCost', 'Q1WaterCost') ='Q1CompCost',
sum(expr))

Expression Q1:

=if(valuelist('Q1CompCost', 'Q1WaterCost') ='Q1WaterCost',
sum(expr))

 

Expression Q2:

=if(valuelist('Q2CompCost', 'Q2WaterCost') ='Q2CompCost',
sum(expr))

Expression Q2:

=if(valuelist('Q2CompCost', 'Q2WaterCost') ='Q2WaterCost',
sum(expr))

 

Put the same name for both expressions in each Quarter: Q1 and Q2 for example

 

To help community find solutions, please don't forget to mark as correct.
Claudiu_Anghelescu
Valued Contributor

Re: Combined Stacked and Grouped Bar Chart

if not works you can try also this:

 

Dimension:

=valuelist('Q1', 'Q2') 

 

Expression Q1:

=if(valuelist('Q1', 'Q2') ='Q1',
sum(Q1CompCost))

Expression Q1:

=if(valuelist('Q1', 'Q2') ='Q1',
sum(Q1WaterCost))

 

Expression Q2:

=if(valuelist('Q1', 'Q2') ='Q2',
sum(Q2CompCost))

Expression Q2:

=if(valuelist('Q1', 'Q2') ='Q12,
sum(Q2WaterCost))

 

...and use the same color for each measure.

To help community find solutions, please don't forget to mark as correct.

View solution in original post

timbatman
New Contributor

Re: Combined Stacked and Grouped Bar Chart

Thank you, worked perfectly.