Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Not applicable

Multi Color Stacked Bar chart

Hello,

I am new to qlikview and currently  working on a requirement to represent data as shown in attached snap shot.

In attached snap shot 2 bars are representing 2 metrics.and no dimensions used

1. Available Hours  = Sum of Non-Chargeable + Sum of Chargeable Hours

2. Stacked bar chart of Non-Chargeable and Chargeable Hours.

Is there a way to achieve such chart?

1 Solution

Accepted Solutions
MVP
MVP

Re: Multi Color Stacked Bar chart

To create your total and your detailed bar, you can do something like this:

Create a synthetic dimension like

=ValueList('1','2')

Then three expressions:

=If(ValueList('1','2')= 1, Rangesum(Sum(Value1), Sum(Value2) ) )

=If(ValueList('1','2')= 2, Sum(Value1) )

=If(ValueList('1','2')= 2, Sum(Value2) )


You can hide the dimension label on dimension tab and then set style to stacked on presentation tab.



StackedGrouped.png

6 Replies
engishfaque
Valued Contributor III

Re: Multi Color Stacked Bar chart

Dear Pradeep,

For stack chart, kindly follow the listed below steps:

Chart Properties > Style Tab > Subtype > Select "Stacked" radio button > Apply > OK.

Kind regards,

Ishfaque Ahmed

Re: Multi Color Stacked Bar chart

Please send the qvw file. So that, We can respond back and easy to monitor also....

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Not applicable

Re: Multi Color Stacked  Bar chart

Hello Ishfaque,

Thanks for your response. However, my requirement is different here.

I have 2 metrics displaying in the form of bars.

1st bar in the chart indicates metrics 1 (=sum({<[HT] = {'Available'}>}Hours) ).

2nd bar indicates metric 2. But metric 2 aggregation is based on a conditional aggregation. (=sum({<[HT] = {'Non Chargeable','Chargeable'}>}Hours) ).

As metric 1 is derived from a single condition , there needs to be only one color for bar.

But since metric 2 is derived based on 2 values , we need 2nd bar in 2 colors.

Thanks,

Pradeep

MVP
MVP

Re: Multi Color Stacked Bar chart

To create your total and your detailed bar, you can do something like this:

Create a synthetic dimension like

=ValueList('1','2')

Then three expressions:

=If(ValueList('1','2')= 1, Rangesum(Sum(Value1), Sum(Value2) ) )

=If(ValueList('1','2')= 2, Sum(Value1) )

=If(ValueList('1','2')= 2, Sum(Value2) )


You can hide the dimension label on dimension tab and then set style to stacked on presentation tab.



StackedGrouped.png

HirisH_V7
Honored Contributor

Re: Multi Color Stacked Bar chart

Hi,

By using the sample data,

Data:

LOAD * INLINE [

    Non-Chargeble, Chargeable

    1, 2

    2, 1

    4, 2

];

Creating a stacked bar chart using ,

Dimension:-

=ValueList(1,2)

Expressions:-

If(Valuelist(1,2)=2,Sum(Chargeable))

If(Valuelist(1,2)=2,Sum([Non-Chargeble]))

If(Valuelist(1,2)=1,Sum(Chargeable)+Sum([Non-Chargeble]))


stacked chart will look like this,

Stacked Bar No Dimension-217180.PNG

HTH,

PFA,

Hirish

HirisH
“Aspire to Inspire before we Expire!”
Not applicable

Re: Multi Color Stacked  Bar chart

Thanks alot Wuehl. This is what i needed. And i followed the approach you mentioned and it is working as expected.

Thanks alot again.