Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a field with interval function like below. When i export to excel, it comes with a suffix AM/PM.
Interval(END_DT-BEGIN_DT, 'hh:mm:ss')
field
8:00:00 PM
See the default format on your main script. If i'm not wrong, you got something like this (see the attached file).
Change the time format in your script from "SET TimeFormat='h:mm:ss TT';" to this "SET TimeFormat='hh:mm:ss';".
Thanks for you reply
I have made the change as you mentioned but still getting the same issue while exporting to excel.
SET TimeFormat='hh:mm:ss'
SET TimestampFormat='M/D/YYYY h:mm:ss[.fff] TT';
Dont Change Any key Variables in qlik script. The Culprit is Excel, not on the Qlik Side.
This issue occurs because Excel treats hh:mm:ss as a time and formats it as a timestamp hence adds an "AM/PM" suffix.
To address this, you need to export the duration in a text format so Excel does not interpret it as a time value.
if you dont wrap it in Text() , i.e if you use something like below, it will formatted by excel.
Interval(END_DT - BEGIN_DT, 'hh:mm:ss')) AS Duration:
if you wrap it in Text() , In this format, Excel will display the duration as-is, without interpreting it as a time.
Text(Interval(END_DT - BEGIN_DT, 'hh:mm:ss')) AS DurationAsText:
The Text() function ensures the Interval() output is treated as plain text, preventing Excel from reformatting it as a time value.