Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calculate ratio with measurements on multiple rows

Hi everyone,

I'm very new on QlikSense but already loving it !

I think I have missed something in the way of building expressions, or maybe what I want to do is not possible, but I can't find a way to do calculate my percentage. Here is an example :

 

TaskStatusCount
task1ok123
task1failed5
task2ok45
task2failed20
task3ok68
task3failed2
task4ok147
task4failed33

As you can see, each task can have 2 statuses which can be "failed" or "ok".

I want to get the success rate of each task by calculating the ratio of successful vs failed tasks.

Thanks in advance for any help !

1 Solution

Accepted Solutions
sunny_talwar

Is this what you want?

Capture.PNG

View solution in original post

10 Replies
sunny_talwar

successful vs failed or successful vs overall?

Successful vs failed:

Sum({<Status = {'ok'}>}Count)/Sum({<Status = {'failed'}>}Count)

Successful vs overall:

Sum({<Status = {'ok'}>}Count)/Sum(Count)

ramoncova06
Partner - Specialist III
Partner - Specialist III

Sunny already provided an answer

Not applicable
Author

Hi,

Thanks for your fast answer !

I tryed your expression, adding a measure to my simple table, but only the total ration is calculated. All the other rows have 0 value, and I need this ratio for each task.

sunny_talwar

Is this what you want?

Capture.PNG

Not applicable
Author

Yes perfect ! Sorry I did not understand that I needed to make an other table.

Now I understand far better how it works !

Thank you for your amazing help !

sunny_talwar

No problem at all

Not applicable
Author

is there a way to get ratio as non %?

sunny_talwar

Not sure if I understand your question?

Not applicable
Author

for ex:

if i want the ratio from start to finish .

start:     finish

3          6

5          10        

20          100

i know how to use expression to get % but i want to show as 3:6 which simplifies to 1:3,  and 5:10 will be 1:5 and 20:100 will be 5:25

thanks