I have a timestamp where I formatted it with the following load:
Timestamp([Timestamp2] ,'YYYY-MM-DD hh:mm[:ss[.fff]]') AS [Timestamp];
When visualizing it in the table it shows correctly, for example:
2023-04-21 12:16
When i try to visualize it in a line chart however it shows as am/pm. How can I get the timeformat in the same format in the charts x-axis?
Edit
Showing the desired output as in another app (also with continuous scaling enabled):
I actually learned something new here -- you can change the formatting of those continuous x-axis labels by updating the default formatting variables in the Data Load Editor. You probably have this value in the default Main script section:
SET TimestampFormat='M/D/YYYY h:mm:ss[.fff] TT';
All you need to do is get rid of the TT
at the end of it:
SET TimestampFormat='M/D/YYYY h:mm:ss[.fff]';
Then it updates those labels:
The reason the time is formatted differently in the line chart axis is because you have continuous scale turned on. You can toggle the setting from the X-axis tab in the Appearance settings for the chart:
The continuous scale can be helpful for when you have a "continuous" dimension, like a timestamp, and you want to be able to freely zoom in and out, thereby scaling the line chart out to days/weeks/months or down to hours/minutes/seconds. Qlik can do this because time is a linear, ordered, scalable thing. The sacrifice we make, though, is that we don't get to control the formatting of those time scales -- we can't tell Qlik how to format the "time" part of the scaled view, in your case.
Alternatively, you could turn off the Continuous scale, as shown in the screenshot above, and then we are back to having full control over the formatting of our timestamp dimension. We give up, of course, the "scalability" factor that allows us to easily zoom in and out of the time scale -- rather, each timestamp value is treated as "just another dimension value" and Qlik eschews "time awareness."
One of the tricks you could try to get the best of both worlds is to use Drill-down Groups to create a hierarchy from Month --> Week --> Timestamp or whatever makes sense to you. Doing that allows you to select into a particular high-level date value and then "drill down" into a more granular time value, like so: