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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

& in chart expression

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

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

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?

1 Solution

Accepted Solutions
Anil_Babu_Samineni

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))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful

View solution in original post

3 Replies
Anil_Babu_Samineni

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))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

Booyakasha!

Thanks a stack it worked a treat!

Anonymous
Not applicable
Author

What?

booyakasha

  1. (slang) used to express triumph, normally if trying to appear a "gangsta".

Apologies if I offended you lol