9 Replies Latest reply: Oct 2, 2018 9:53 AM by Shakeeb Mohammed

# 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!!

• ###### Re: Count as a Percentage

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?

• ###### Re: Count as a Percentage
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.

• ###### Re: Count as a Percentage

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

• ###### Re: Count as a Percentage

Sorry-

LocationNo. VisitsOnTime %Late %
Nottingham250%50%
Derby367%33%
Birmingham250%50%
• ###### Re: Count as a Percentage

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:

• ###### Re: Count as a Percentage

How come my percentages are showing way out?

• ###### Re: Count as a Percentage

what dimension and measure u're using?

It's not clear in the image

• ###### Re: Count as a Percentage

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)

• ###### Re: Count as a Percentage

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