Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am trying to add a custom duration expression to my line chart.
Using...
=FLOOR((AVG(IF(TEU=1,UnpackTime)/3600)))&'h'&ROUND(MOD(ROUND(AVG(IF(TEU=1,UnpackTime))),3600)/60)&'min'
...seems to work great in a Text Object however when using this same logic within Line Chart>Properties>Expression>Definition the chart returns blank as per below:
![2018-01-19 15_10_19-QlikView x64 Personal Edition - [C__Users_cgentles_Desktop_ImportUnpack.qvw_].png](/legacyfs/online/190673_2018-01-19 15_10_19-QlikView x64 Personal Edition - [C__Users_cgentles_Desktop_ImportUnpack.qvw_].png)
When I remove the &'h' and &'min' the values are displayed on the chart (as per below) but not in the format that I require. Obviously the addition of custom suffixes ('h' and 'mins') is causing the chart to display blank values.
![2018-01-19 15_14_36-QlikView x64 Personal Edition - [C__Users_cgentles_Desktop_ImportUnpack.qvw_].png](/legacyfs/online/190674_2018-01-19 15_14_36-QlikView x64 Personal Edition - [C__Users_cgentles_Desktop_ImportUnpack.qvw_].png)
Can someone please tell me how I can get 'h' and 'mins' added to the chart data points so that it is displayed as 3h29mins for example?
Perhaps this?
=Dual(FLOOR((AVG(IF(TEU=1,UnpackTime)/3600)))&'h'&ROUND(MOD(ROUND(AVG(IF(TEU=1,UnpackTime))),3600)/60)&'min',FLOOR((AVG(IF(TEU=1,UnpackTime)/3600)))&ROUND(MOD(ROUND(AVG(IF(TEU=1,UnpackTime))),3600)/60))
Perhaps this?
=Dual(FLOOR((AVG(IF(TEU=1,UnpackTime)/3600)))&'h'&ROUND(MOD(ROUND(AVG(IF(TEU=1,UnpackTime))),3600)/60)&'min',FLOOR((AVG(IF(TEU=1,UnpackTime)/3600)))&ROUND(MOD(ROUND(AVG(IF(TEU=1,UnpackTime))),3600)/60))
Booyakasha!
Thanks a stack it worked a treat!