Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Customer & Partners, DEC. 9, 11 AM ET: Qlik Product & Strategy Roadmap Session: Data Analytics REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
shakeeb_mohammed
Contributor III
Contributor III

Count as a Percentage

Hi Can someone assist with the below please?

Sample data :

TripDelivery Point Delivery Status
001Derby

OnTime

001NottinghamLate
002NottinghamOnTime
002BirminghamLate
002DerbyOnTime
003BirminghamOnTime
003DerbyLate

I need to somehow show how many Distinct Delivery Point to a Trip were on OnTime or Late..

E.g. There has been a total of 7 Departures - 4 of them were OnTime and 3 of them were Late

Derby had 2 OnTime for 2 trips and 1 Late for 1 Trip.

The Idea is so i can show this as a percentage - Count Ontime by Delivery Point / Total Distinct Trips

Hope this makes sense!!

1 Solution

Accepted Solutions
OmarBenSalem
Partner
Partner

on time : =count({<[Delivery Status]={'OnTime'}>}Trip)/count(distinct Trip)

Late : =count({<[Delivery Status]=-{'OnTime'}>}Trip)/count(distinct Trip)

No Visits : count(distinct Trip)

result:

Capture.PNG

View solution in original post

9 Replies
OmarBenSalem
Partner
Partner

U want the count by trip or delivery pioint?

Could u create a table with the output u want as u've done for the input data?

shakeeb_mohammed
Contributor III
Contributor III
Author

LocationOnTime %Late %
Derby75%25%
Birmingham60%40%
Manchester70%30%

I need to show how many delivery points are in 1 trip and its percentage by location.

OmarBenSalem
Partner
Partner

Still can't figure out how Derby is 75% OnTime ?

OmarBenSalem
Partner
Partner

wouldn't this be more "accurate"? Mayube i'm missing sthing!

Capture.PNG

shakeeb_mohammed
Contributor III
Contributor III
Author

Sorry-

LocationNo. VisitsOnTime %Late %
Nottingham250%50%
Derby367%33%
Birmingham250%50%
OmarBenSalem
Partner
Partner

on time : =count({<[Delivery Status]={'OnTime'}>}Trip)/count(distinct Trip)

Late : =count({<[Delivery Status]=-{'OnTime'}>}Trip)/count(distinct Trip)

No Visits : count(distinct Trip)

result:

Capture.PNG

View solution in original post

shakeeb_mohammed
Contributor III
Contributor III
Author

How come my percentages are showing way out?

Capture.JPG

OmarBenSalem
Partner
Partner

what dimension and measure u're using?

It's not clear in the image

shakeeb_mohammed
Contributor III
Contributor III
Author

I had to use distinct twice as the data I'm using had more that 1 trip number.

I used

=count({<[DeliveryStatusByBookingTime]={'OnTime'}>}Distinct Trip)/count(distinct Trip)