Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Carreaucaro14
Contributor II
Contributor II

Rounding of the duration format is different depending on the object

Hello,

I created a new measure in the master items about working time. 

I use this master item in multiple object for tests.

For a particular case my result should be 22:16.

But the result depend on the object i choose (22:15 vs 22:16).

"22:15" : Combo chart, distribution plot, waterfall chart

"22:16" : bar chart, KPI, line chart, gauge, treemap, circular reference, bullet chart

Carreaucaro14_0-1731057167952.png

 

 

Some of results are not the same between the result on the object and the tooltips.

Carreaucaro14_1-1731057168122.png

 

 

Moreover, for example, on the combo chart, the result on the graph is  = 22:15. But if i click on "Show data" the result is = 22:16

Carreaucaro14_2-1731057168480.png

 

Carreaucaro14_3-1731057168154.png

 

Does anybody have an explanation ?

Thank you,

Caroline JEHANNIN

Labels (1)
10 Replies
Qrishna
Master
Master

i see rounding of the number is a bit different everywhere. so what do you want to show everywhere? 22:15 or 22:16. ?

Carreaucaro14
Contributor II
Contributor II
Author

My result should be : 22:16

For more precision, if i add second to my format i have : 22:15:59 vs 22:16:00. But i need to show the following format : "hh:mm"

I don't understand why the result is different between objects when the calculation is the same (i use measure from master items). And i don't understand why the result is different in a same object : data on graph vs tooltips vs result in "Show data".

I use the following calculation : interval(round(sum(PRO_001_TEMPS_TRAVAIL_ESTIM),1/(24*60)), 'hh:mm')

Qrishna
Master
Master

try ceil function everywhere. something like this: interval(ceil(sum(PRO_001_TEMPS_TRAVAIL_ESTIM) * 1440) / 1440, 'hh:mm')

Carreaucaro14
Contributor II
Contributor II
Author

It doesn't work, i have same results

Kushal_Chawda

@Carreaucaro14  try below

time(sum(PRO_001_TEMPS_TRAVAIL_ESTIM)/1440, 'hh:mm')

marcus_sommer

Take a look that the results are shown equally in all places - means to display always the formular-formatted value and not any automatic or object-formatting.

An alternate approach may be to use a dual(), maybe in this way:

dual(interval(round(sum(PRO_001_TEMPS_TRAVAIL_ESTIM),1/(24*60)), 'hh:mm'),
        round(sum(PRO_001_TEMPS_TRAVAIL_ESTIM),1/(24*60))

leonjack01
Contributor
Contributor

It is like different objects might be using different rounding rules for time formats. Try checking the number formatting settings for each object Abougoush Law to ensure they’re all consistent. You might need to adjust the rounding options or use a custom rounding function in your measure.

Carreaucaro14
Contributor II
Contributor II
Author

I checked every object and formatting settings are the same. I use the same measure from master items and i didn't change anything about setting's object. 

I tried to round my measure in differents ways but the result is the same (I tried the different solutions proposed in the post + other methods).

marcus_sommer

If you want to use a customized format you need to ensure that's applied everywhere. I'm not sure but I assume that the most objects won't use it by default else applying an automatic one.

Beside this make sure that the object-dimensionality is everywhere the same - means all use the same possible values from the data-set. Features like hiding NULL or using accumulations, contineous scale and similar ones as well as combining dimensions from n tables which aren't suitable associated could also have an impact on the results.

At first I would skip the master-measure and plying with direct measures - with an without rounding/formatting as well as within table-charts - you need exactly to know the chart-results before looking for any rounding/formatting issues.