12 Replies Latest reply: Jul 18, 2017 4:53 AM by Joanna Seldon

# Add two types of percentage calculation together in one measure on a bar chart

Hi

Using Qlik Sense

I am trying to Add two types of percentage calculation together in one measure on a bar chart

The dimension is calendar year

I currently have two percentage measures on the bar chart

the calculations look like

e.g

count({\$<SectorID={"1"}, OrderCompleted = {"Yes"}>}SectorID) / count({\$<SectorID={"1"}>}SectorID)

but I wish to add / combine this second calculation percentage as one measure on the bar chart

sum({\$<SectorID={"20"}>}FinalSaleValue) / sum({\$<SectorID={"20"}>}OverallSaleValue)

I have tried with no joy encapsulating the vales

(count({\$<SectorID={"1"}, OrderCompleted = {"Yes"}>}SectorID) / count({\$<SectorID={"1"}>}SectorID)) +

(sum({\$<SectorID={"20"}>}FinalSaleValue) / sum({\$<SectorID={"20"}>}OverallSaleValue))

• ###### Re: Add two types of percentage calculation together in one measure on a bar chart

If you add them as two different expressions, do you see the bars next to each other?

• ###### Re: Add two types of percentage calculation together in one measure on a bar chart

Hi

when I have two expressions (as two separate measures) I do have two separate bars in the graph

I wish to combine the percentage totals together as one bar in the graph..

the issue I think I can see is one percentage is worked out as count and the other is sum, hence why I have tried encapsulating it..

kind regards

• ###### Re: Add two types of percentage calculation together in one measure on a bar chart

I am not sure I am able to understand what you are having. I don't think count % and Sum% should have any problem getting added up. Can you at least share some snapshots where you have both of them as a separate expressions in a bar chart or table?

• ###### Re: Add two types of percentage calculation together in one measure on a bar chart

Hi

that's what I thought , encapsulating always works when doing charts with e.g

(count ({<Country={"USA"}>}ID) / count (ID)) +

that's why I think there is an issue with using a count and a sum

• ###### Re: Add two types of percentage calculation together in one measure on a bar chart

Can try to help if you share a sample. Out of ideas

• ###### Re: Add two types of percentage calculation together in one measure on a bar chart

hi

and my two measures are

Measure one

count({\$<SectorID={"1"}, OrderCompleted = {"Yes"}>}SectorID) / count({\$<SectorID={"1"}>}SectorID)

Measure two

sum({\$<SectorID={"20"}>}FinalSaleValue) / sum({\$<SectorID={"20"}>}OverallSaleValue)

I wish to combine measure 1 and 2 in one measure

• ###### Re: Add two types of percentage calculation together in one measure on a bar chart

I don't see any bar, do you?

• ###### Re: Add two types of percentage calculation together in one measure on a bar chart

when I do it as separate measures I do

when I try and do this

(count({\$<SectorID={"1"}, OrderCompleted = {"Yes"}>}SectorID) / count({\$<SectorID={"1"}>}SectorID)) +

(sum({\$<SectorID={"20"}>}FinalSaleValue) / sum({\$<SectorID={"20"}>}OverallSaleValue))

just gives me the above

• ###### Re: Add two types of percentage calculation together in one measure on a bar chart

I don't see it

• ###### Re: Add two types of percentage calculation together in one measure on a bar chart

Hi

that pic is the result I am getting when trying to add the two percentage  expressions together

• ###### Re: Add two types of percentage calculation together in one measure on a bar chart

Hi

I have manage to get this to work,

the issue was that it cannot add up two % when one sum is based on "count" and the other is "Sum"

but thanks team. x