Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Announcements
QlikWorld, June 24-25, 2020. Free virtual event for DI and DA gurus. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

Stacked Bar Chart

I am having trouble with displaying my bar chart at 100%. I was able to accomplish this in esxcell but i can't get it to work in QV.

Dimension:

  • Product Name

Measure:

  • % of Total (=SUM({<month_offset={[>=-1<0]}>}price)/100000
  • %of Last 3 Month (=SUM({<month_offset={[>=-1<0]}>}price)+SUM({<month_offset={[>=-2<0]}>}price)+SUM({<month_offset={[>=-3<0]}>}price)/1000000

Please help!

12-2-2014 12-46-13 PM.png

12-2-2014 12-52-50 PM.png12-2-2014 12-54-23 PM.png

Tags (1)
5 Replies
Highlighted

Re: Stacked Bar Chart

Hi,

Click on Relative check box from Expression table.

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Highlighted
Not applicable

Re: Stacked Bar Chart

Thank you!

I am almost there.Here is what my chart looks like now

12-2-2014 1-09-21 PM.png

And i am looking to do something like this:

12-2-2014 12-46-13 PM.png

Highlighted
Not applicable

Re: Stacked Bar Chart

Any suggestions on this one?

Highlighted
Not applicable

Re: Stacked Bar Chart

I think it has to do with dimensions. Now, your expressions are presented per dimension. For each dimension, there is a Last(?) and Total expression. I can imagine that you can achieve the excel layout by using a dimension that contains all your previous dimension units.

Did it help? With a sample qvw I could give you a  better answer.

Best,

T

Highlighted
Employee
Employee

Re: Stacked Bar Chart

Hi Zhenya,

I think what you need here is a handy thing called ValueList(). This allows you to create a synthetic dimension which you can then use to define two different expressions on the same axis. Here is my example built using ValueList().Stacked ValueList Example.png

More info on ValueList can be seen at: ValueList() – For those tricky situations

As we are creating a synthetic dimension the "Relative" tickbox won't quite work right so you will need to use a bit of set analysis to define the total sales to compare against and give you a nice percentage. The dimensions and expression I used are:

Dimensions: =ValueList('Last 3', 'All'); CategoryName

Expression: =If(ValueList('Last 3','All')='Last 3',Sum({<Month={'Dec'}>}Sales)/Sum(TOTAL {<Month={'Dec'}>} Sales),Sum(Sales)/Sum(TOTAL Sales))

I have attached my example app so you can see what I have done and have a play with it. You will need to tweak it to your own fields but this should be fairly simple.

Hope that helps.

Adam