# Qlik Sense App Development

Contributor II

## percentage brackets

Hiya

I have a calculation / expression that calculates parcels delivery time expectancy.

this shows if it was 100 % on time, or percentage over or under time

in the table i have already a column that works out as a number how many days its taken between order date and delivery date, hence getting the percentage is easy.

However...

i need to do this calculation in the data load, so i can divide customers into percentage groups. this is so in the app i could

use a pivot table

to show e.g

e.g 5 customers , from catering department, delivery time...was in the 100 % section

e.g 2 customers , from catering department, delivery time...was in the 0- 25 % section

i need help on this

4 Replies
MVP

## Re: percentage brackets

If you want useful help for this, I suggest that you post a representative sample qvw file, along with representative sample source data (in inline loads, spreadsheets, csv files or qvd files).

You are looking at an interval match, class() function or nested if to classify the detail.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Contributor II

## Re: percentage brackets

Hiya

Table shows

OrderDate,       Deliverydate,    EstDeliveryDate     DateDaysFordelivery       DaysTakenDelivery

01/11/2014        09/11/2014        30/11/2014                         30                                 20

kpi  / expression in app already works out percentage of days take between in app  between  DaysFordelivery and DaysTakenDelivery

Not applicable

## Re: percentage brackets

IF(<Percentage> >= 0 AND <Percentage> < 10, '10 Percent Group',

IF(<Percentage> >= 10 AND <Percentage> < 20, '20 Percent Group',

...................

IF(<Percentage> >=90 and <Percentage> < 100, '90 Percent Group', '100 Percent Group')

))))))

check you have the right number of closing brackets (i haven't checked!)

Contributor II

## Re: percentage brackets

Hiya

thanks , but using your help done it a slightly different way

if((DaysTakenDelivery /  DateDaysFordelivery  ) >= '1', 1,0) as MoreHundredPercent,

ect... different 'if' for each percentage bracket

then counted each percentage group in expression for the chart

Kind Regards