Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to create histograms which compare indexed values to actuals across multiple variables

Hi

I'm very, very new to QV so hoping someone will be able to help me with this.

I have two tables, the first contains records for people with various marital status fields which have an assigned probability index:

Person Divorced Single Married Widowed

A 0.25 0.25 0.50 0.00

B 0.50 0.00 0.00 0.50

C 0.00 0.75 0.25 0.00

The second table contains actuals for the population:

Town PP_Divorced PP_Single PP_Married PP_Widowed TotalPop

A 1 3 3 2 9

B 0 5 5 1 11

I'm trying to create a bar chart that will have the marital status on the x-axis, and two bars for each showing the distribution (ie For Actuals, Divorced 25%, Single 42%, Married 25% and Widowed 8%, while the values for the Population would be 5%, 40%, 40% and 15% respectively). I can generate separate graphs, by calculating each bar on the Actuals using a formula (sum(VariableName)/count(VariableName)), and for the Population each bar has the formula (sum(VariableName)/sum(TotalPop)).

My questions are:

1) Is their a more efficient way of doing this, rather than having to recalculate each variable as a separate expression?

2) How can I do this on the same chart? (Without having to rename the labels)

0 Replies