Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am creating an hour by hour chart. I need help formatting my time so that it will display as HH tt MM-DD-YYYY. For example, I want the x-axis to show 10 AM 01-07-2020. I don't want to just display the hour because it will stack the next day's hour by hour data. Right now I am using: date([time],'MM-DD') & ' ' & mid([time],12,2) as NewDateHour and letting NewDateHour be the dimension, but this displays as 01-07 10. Can someone help me with a load script line to format time as 10 AM 01-07? Thanks in advance!! 😁
Hi
try putting as a dimension
or
you can create a field in the script and use it in the chart
Thanks
You can create two separate field (Hour & Date) just for sort purpose like below
hour (DateField) as Hour
Date (DateField,DD/MM/YYY) as Date
You can change the format as per your choice
Now in chart properties->Sort-> for x-axis field -> Sort it by Expression -> Put below expression
=Hour & Date
Hi
Try this
Timestamp( Column, 'hh TT MM-DD-YYYY')
Hope this helps
Thanks
Should I do this in the presentation layer(where I put my dimension)?
Hi
try putting as a dimension
or
you can create a field in the script and use it in the chart
Thanks
That didn't work as a dimension but I did create it in the load script. The issue I'm having is it is sorting the x-axis by hours and I need it to sort by hour and date. For example, the chart's x-axis goes like.. 10 AM 1/1 10AM 1/2 10 AM 1/3. I want it to display as 10 AM 1/1 11 AM 1/1 12 AM 1/1, etc
Hi
Can u share me a sample QVF file I will try and get u back
Thanks
You can create two separate field (Hour & Date) just for sort purpose like below
hour (DateField) as Hour
Date (DateField,DD/MM/YYY) as Date
You can change the format as per your choice
Now in chart properties->Sort-> for x-axis field -> Sort it by Expression -> Put below expression
=Hour & Date