Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
joeybird
Creator III
Creator III

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

please help

Kind Regards

Joeybird

1 Solution

Accepted Solutions
stigchel
Partner - Master
Partner - Master

Columns? Or rows of data, then try

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

View solution in original post

4 Replies
stigchel
Partner - Master
Partner - Master

Columns? Or rows of data, then try

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

joeybird
Creator III
Creator III
Author

That's brilliant xxx

thank you.

Another question I would like to ask please is if

if I calculated one answer (answer one), then another (answer two) answer.

I wish to do a calculation answer one - answer two

how would I go about it please?

have tried

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

Kind Regards

Joeybird

stigchel
Partner - Master
Partner - Master

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)

joeybird
Creator III
Creator III
Author

Superb!!!

works wonderful

Kind Regards

Joeybird x