11 Replies Latest reply: Dec 26, 2016 8:58 AM by Manish Kachhia

# Need to Create a chart with 2 dimensions and 2 Measures BAR CHART

Hello All.

Issue: how to create 2 Dimensions and 2 Measures Bar Chart.

2 - Dimensions are

1. Year

2. Month

2 - Measures  are

1. Target Sales

2. Actual Sales

• ###### Re: Need to Create a chart with 2 dimensions and 2 Measures BAR CHART

You will not get proper layout if you are using more than two dimensions in QlikView bar chart.

better to use....single dimension as below..

Year & CHR(10) & Month

or

Year & '-' & Month

and use both expressions as your have shown  above..

Check below link for better understanding..

• ###### Re: Need to Create a chart with 2 dimensions and 2 Measures BAR CHART

One thing you could do is combine your Actual and Target Sales Fields

Example

YEar Month SalesType Sales

2016,1,Target,200

2016,1,Actual,400

2016,2,Target,400

2016,2,Actual,300

This way you can create a chart like this

Dimension,Year,Month,SaleType

Expression: Sum(Sale)

• ###### Re: Need to Create a chart with 2 dimensions and 2 Measures BAR CHART

Hi Vieeeth.. if you have more than one year data with different months.. you will get issue..

check below data.

[

YEar, Month, SalesType, Sales

2016,1,Target,200

2016,1,Actual,400

2016,2,Target,400

2016,2,Actual,300

2015,1,Target,200

2015,3,Actual,400

2015,1,Target,400

2015,3,Actual,300

];

• ###### Re: Need to Create a chart with 2 dimensions and 2 Measures BAR CHART

what Kind of issues? it's up to the op to add Set analysis to filter for what year he wants

• ###### Re: Need to Create a chart with 2 dimensions and 2 Measures BAR CHART

ok, you mean missing months for a year. But I think the major problem here was having 2 expressions, which won't be the case

Changed Dimension to

Dim1 = Month & chr(10)& YEar

Dim2 = SalesType

Expression = Sum(Sales)

Sort = NUM(YEar&Month)

• ###### Re: Need to Create a chart with 2 dimensions and 2 Measures BAR CHART

To Avoid repeating labels

Dimension

Dim1 =AGGR(if(Month = Min(TOTAL <YEar> Month),Month & chr(10)&YEar,Month),YEar,Month)

Dim2 = SalesType

Expression = Sum(Sales)

Sort = NUM(YEar&Month) > Ascending

• ###### Re: Need to Create a chart with 2 dimensions and 2 Measures BAR CHART

This will confuse more to end user... In short you can't avoid non associated month with years directly..

• ###### Re: Need to Create a chart with 2 dimensions and 2 Measures BAR CHART

Sorry I didn't quite get what you are trying to say? what is wrong here? This is fairly simple

• ###### Re: Need to Create a chart with 2 dimensions and 2 Measures BAR CHART

I mean to say technically it's correct, but when you are showing to users, it would be difficult for them to understand..because not all months are joined with years on x axis..

Better to use

Month&'-'Year

or

Year&'-'&Month

• ###### Re: Need to Create a chart with 2 dimensions and 2 Measures BAR CHART

oh, well it's up to OP  if he wants to show month and Year for all bars or only preceding

• ###### Re: Need to Create a chart with 2 dimensions and 2 Measures BAR CHART

If you check link from my 1st answer.. you will get the similar question raised by me sometime ago.

My question was bit more descriptive, which will give you idea behind the problem in having Multidimensional Bar Chart...