12 Hour Display with "AM" and "PM" Labels

Data Pipeline

In order to bucket data by hour of day and to display it in 12-hour clock view, set the columns to 12-hour clock, with AM and PM labels.

Select Hour of Day in the Time Bucket Dropdown menu.

Add a Hidden variable

Add an Edit Column step in the Pipeline to as an integer.

Add an Edit Column step in the Pipeline

Add a new column and use a Case Statement to change the hours in a 12 Hour Clock Time of Day with AM and PM labels with the SQLite statement below:

CASE WHEN (“Hour” = 0) THEN “12 AM” WHEN “Hour” = 12 THEN (“Hour” || " PM") 
WHEN “Hour” < 12 THEN (“Hour” || " AM") ELSE ((“hour”-12) || " PM") END

Add a Hide Column step to hide the unnecessary column and reorder so the Hour of Day is the left hand column.

Final result

Related Data Pipeline Help Articles

See more