7 Replies Latest reply: Apr 29, 2015 9:35 AM by Sunny Talwar

percentage calculation

Hiya

trying to calculate a number to percentage...

managed to change the format to custom and 0% no problems there, its just my calculation I need help with please?

I have a number of customers every month, and a bar chart that shows these total number of customers per month for a year

e.g Jan 1000 Feb 1500 Mar 1300 ect

but I have calculated too a KPI how many customers had product delivered in 7 days. (done in data load editor and creates the field "Delivered Within 7 Days")

I want to work out a percentage

that e.g in Jan out of total number of customers for the month (this case a 1000) how much in percentage of customers had their product delivered within 7 days

I got a code like this but it just gives me 100% for all months

(count([Delivered Within 7 Days]) )/  count ([customer])

Kind Regards

Joeybird

• Re: percentage calculation

I understand what you are looking for, but not entirely sure how your data looks, would you be able to share some sample data for Delivered Within 7 Days and Customer columns together with your dimension you are using.

Best,

Sunny

• Re: percentage calculation

Hiya

sorry cant post as office work... but all I know there is something wrong with the calculation

(count([Delivered Within 7 Days]) )/  count ([customer])

can you please amend so all values show correctly and not all show 100% please

kind regards

joeybird

• Re: percentage calculation

What does [Delivered Within 7 Days] column include? Does it say yes and no or does it only have value when its true? Until I know what's the content of that field, I won't know the problem.

Best,

Sunny

• Re: percentage calculation

Hiya

"Delivered Within 7 Days" field

it contains a 1 if true and 0 if false

kind regards

joeybird

• Re: percentage calculation

Try this out:

Sum([Delivered Within 7 Days])/Count([customer])

• Re: percentage calculation

fab!!!

thank you

kind regards

joeybird

• Re: percentage calculation

No problem! I am glad I was able to help.

Best,

Sunny