Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
asb02512
Contributor III
Contributor III

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

anyone please help

11 Replies
MK_QSL
MVP
MVP

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..

https://community.qlik.com/thread/231493

vinieme12
Champion III
Champion III

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)

bar.PNG

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
MK_QSL
MVP
MVP

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

check below data.

Load * Inline

[

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

];

vinieme12
Champion III
Champion III

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

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
vinieme12
Champion III
Champion III

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)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
vinieme12
Champion III
Champion III

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

bar2.PNG

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
MK_QSL
MVP
MVP

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

vinieme12
Champion III
Champion III

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

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
MK_QSL
MVP
MVP

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