cancel
Showing results for 
Search instead for 
Did you mean: 

Convert numbers to sum in Webi

former_member334960
Participant
0 Kudos

Hi All,

I have a requirement to show the sum of numbers in the form of time.

Eg:

Sum should be 7 but it is showing as 6.20. Can someone please suggest on this?

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

amitrathi239
Active Contributor
0 Kudos

use this in the total row.

First i am converting number to string data type to exract hour and mintues in seprate.After that i have converted mintues to hour and added.

=Sum(ToNumber(Substr(FormatNumber([TIME];"0.00");1;Pos(FormatNumber([TIME];"0.00");".")-1))+ToNumber(Right(FormatNumber([TIME];"0.00");2);"00")/60)

former_member334960
Participant
0 Kudos

HI Amit,

Thanks for the detailes formula.

This formula worked fine, but while I was testing I found few discrepency for few.. Please find below one set of data.

Output from Bex:

bex.png

Webi output:

webi.png

Can you please let me know what I can correct?

amitrathi239
Active Contributor
0 Kudos

follow these steps.

Var1=Sum(ToNumber(Substr(FormatNumber([TIME];"0.00");1;Pos(FormatNumber([TIME];"0.00");".")-1))+ToNumber(Right(FormatNumber([TIME];"0.00");2);"00")/60)

Final=ToNumber(Substr(FormatNumber([Var1];"0.00");1;Pos(FormatNumber([Var1];"0.00");".")-1))+ToNumber(Right(FormatNumber([Var1];"0.00");2);"00")/10000*60

Drag this in the total row.

former_member334960
Participant
0 Kudos

Thank you so much Amit. Your solution worked for me.

Answers (1)

Answers (1)

amitrathi239
Active Contributor
0 Kudos

Based on the screenshot total of all entries is 6.2.How are you expecting it should be 7?

time column is based on variable or direct object? in case of variable then use foreach () in sum row and add dimensions which needs to be there.

former_member334960
Participant
0 Kudos

If you consider 2.30 as 2hs and 30mins, then we can get the overall sum as 7. Can we get this?