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

Expression Help Required

Hi all,

Just a quick question from me, I'm struggling to get the correct expression to give me a quality score. The data is laid out in the following way:

RunDate Metric Measure Value
01/03/2023 Cyclops_Title Total count 15909416
01/03/2023 Cyclops_Title Invalid_Name 923438
01/03/2023 Cyclops_Title Inaccurate_Name 30814
01/03/2023 Cyclops_Title Incomplete_Name 74848
01/03/2023 Cyclops_Title Invalid_Title 246124
01/03/2023 Cyclops_Title Inaccurate_Title 19061
01/03/2023 Cyclops_Title Incomplete_Title 25686

 

So I'd need a % score in a new column where it divides the measure by the Total count...can anyone help me out please?

Labels (1)
2 Solutions

Accepted Solutions
Kushal_Chawda

@samvile18  It all depends on how you want to calculate your share. I am assuming for each Date and Metrics you would want share, but if date do not take part just use Metrics in Total qualifier

Sum({<Measure-={'Total count'}>} Value)/Sum(TOTAL <RunDate,Metrics>{<Measure={'Total count'}>} Value)

or

Sum({<Measure-={'Total count'}>} Value)/Sum(TOTAL <Metrics>{<Measure={'Total count'}>} Value)

 

View solution in original post

Sabrina_V
Partner - Creator II
Partner - Creator II

Sum({<Measure-={'Total count'}>} Value)/Sum(TOTAL <Metric> {<Measure={'Total count'}>} Value)

 

Sabrina_V_0-1682339568847.png

 

View solution in original post

9 Replies
Sabrina_V
Partner - Creator II
Partner - Creator II

Maybe try this :

Sum({<Measure-={'Total count'}>} Value) / Sum({<Measure={'Total count'}>} Value)

And then you need to format the measure in %

samvile18
Creator III
Creator III
Author

That's what I tried originally but I can't get it to return anything other than null...no idea why it isn't working. 

Kushal_Chawda

@samvile18  providing sample with expected output will be useful to get correct answers quickly.

samvile18
Creator III
Creator III
Author

samvile18_0-1682336971591.png

I've copied the table I have in Qlik and I've added the data coming in too. Essentially I'd be hoping to have a % Score column next to each measure. So each measure under Cyclops_Address would use the relevant total. 

Sabrina_V
Partner - Creator II
Partner - Creator II

Sum({<Measure-={'Total count'}>} Value)/Sum(TOTAL {<Measure={'Total count'}>} Value)

Sabrina_V_0-1682337144735.png

 

 

samvile18
Creator III
Creator III
Author

How would you extend this to cater for the different groups of Metric? Like in the following picture:

samvile18_0-1682338922910.png

So anything under Cyclops_Address would need to use the Cyclops_Address Total count...whereas Cylcops_DOB would need to use the Cyclops_DOB Total count...and so on. 

Kushal_Chawda

@samvile18  It all depends on how you want to calculate your share. I am assuming for each Date and Metrics you would want share, but if date do not take part just use Metrics in Total qualifier

Sum({<Measure-={'Total count'}>} Value)/Sum(TOTAL <RunDate,Metrics>{<Measure={'Total count'}>} Value)

or

Sum({<Measure-={'Total count'}>} Value)/Sum(TOTAL <Metrics>{<Measure={'Total count'}>} Value)

 

Sabrina_V
Partner - Creator II
Partner - Creator II

Sum({<Measure-={'Total count'}>} Value)/Sum(TOTAL <Metric> {<Measure={'Total count'}>} Value)

 

Sabrina_V_0-1682339568847.png

 

samvile18
Creator III
Creator III
Author

You two are absolute legends - I thought Total but I was putting it in the wrong place because I'm an idiot. Thanks very much