Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

joeybird
Contributor II

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

please help

12 Replies
MVP
MVP

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?

joeybird
Contributor II

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

any ideas please

kind regards


MVP
MVP

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?

joeybird
Contributor II

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)) +

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

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

please help / ideas

Highlighted
MVP
MVP

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

please help / ideas

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

joeybird
Contributor II

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

hi

screenshot.jpg

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

please help


MVP
MVP

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

I don't see any bar, do you?

joeybird
Contributor II

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

please help

MVP
MVP

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

I don't see it

Capture.PNG