# Qlik Sense App Development

Contributor II

## Calculations + conversion

Hiya

I have column called duration, its just a single numbers e.g 210

I have successfully converted this to minutes using

div([Duration], 60) & ':' & Mod([ Duration], 60)

and formatted the KPI to duration to show 3:30

all good if you want to do this for a single line of data

problem... I want to add up a number of columns

I have used this

sum([Duration]) + Div([Duration], 60) & ':' & Mod([Duration], 60)

to try and add up all the columns and the convert to minutes

it maybe a typo. I have tried different variant's and no joy

Kind Regards

Joeybird

1 Solution

Accepted Solutions
Honored Contributor

## Re: Calculations + conversion

Columns? Or rows of data, then try

Div(Sum([Duration]), 60) & ':' & Mod(Sum([Duration]), 60)

4 Replies
Honored Contributor

## Re: Calculations + conversion

Columns? Or rows of data, then try

Div(Sum([Duration]), 60) & ':' & Mod(Sum([Duration]), 60)

Contributor II

## Re: Calculations + conversion

That's brilliant xxx

thank you.

have tried

Div(Sum([Duration]), 60) & ':' & Mod(Sum([Duration]), 60) - Div(Sum([Duration_Finish_Time]), 60) & ':' & Mod(Sum([Duration_Finish_Time]),

Kind Regards

Joeybird

Honored Contributor

## Re: Calculations + conversion

Do the conversion after any calculation, the conversion results in a string with which you can't calculate.

Something like (if I did not make a typo)

Div((Sum([Duration]) - Sum([Duration_Finish_Time])),60) & ':' & Mod((Sum([Duration]) - Sum([Duration_Finish_Time])),60)

Contributor II

Superb!!!

works wonderful

Kind Regards

Joeybird x