Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
asb02512
New 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
MVP
MVP

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

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

vinieme12
Esteemed Contributor II

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)

bar.PNG

MVP
MVP

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.

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
Esteemed Contributor II

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

vinieme12
Esteemed Contributor II

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)

vinieme12
Esteemed Contributor II

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

bar2.PNG

MVP
MVP

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

vinieme12
Esteemed Contributor II

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

MVP
MVP

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