Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Share your agentic AI experience, learn from others, and earn a new badge: Put Agentic AI to Work
cancel
Showing results for 
Search instead for 
Did you mean: 
Amit_B
Creator III
Creator III

Bar Chart with 2 dimensions and 2 measures

Hi,

I'm trying to create a bar chart with 2 dimensions (expense type and year) and 2 measures (actual cost and budget cost).
My goal is to display separate bars for actual cost and budget for each selected year for every expense type.

The standard chart doesn't support using 2 dimensions and 2 measures.
Is there any trick I can use to achieve this?

Thanks.

Labels (4)
2 Replies
Or
MVP
MVP

Generally, the workaround is to concatenate your dimensions into a single dimension, e.g. 2022-Type1, 2022-Type2, 2023-Type1, etc. 

Same concept is mentioned here, though not explained in full, and in several other threads:

https://community.qlik.com/t5/Visualization-and-Usability/Bar-chart-with-Multiple-dimensions-and-mea...

But generally you want a calculated dimension that is just =Dim1 & ' - ' & Dim2. Note that you may need to use Aggr() depending on the scope. 

In your scenario, it looks like you may want to flip around the measure/legend pairing and go with Year & Budget or Year & Actual, with a single measure that checks which kind it is and sums the appropriate field. You can then use the second (legend) dimension for Expense Type.  

 

Chanty4u
MVP
MVP

Hi may be this 

Use a drill-down or trellis chart

You can use:

Expense Type as the main dimension

Year as a drill-down dimension

Actual and Budget as measures.

 

Or 

Use combo chart

Or 

If possible, transform your data from:

Expense Type

Year

Actual

Budget

Travel

2025

100

120

Travel

2026

110

130

into:

Expense Type

Year

Cost Type

Amount

Travel

2025

Actual

100

Travel

2025

Budget

120

Travel

2026

Actual

110

Travel

2026

Budget

130

Then use:

Dimension 1: Expense Type

Dimension 2: Year

Measure: Sum(Amount)

Color by: Cost Type