Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
evansabres
Specialist
Specialist

Mapping

I have a field called HOUR BLOCK (0,1,2,3,4-23) corresponding to 12:00 AM - 11:00 PM.

How do I go about mapping the true times to the numeric values. I have created an inline table:

TimeMap:

LOAD * INLINE

[HOUR BLOCK, Real Time

0, 12:00 AM

1, 1:00 AM

2, 2:00 AM

3, 3:00 AM

4, 4:00 AM

5, 5:00 AM

6, 6:00 AM

7, 7:00 AM

8, 8:00 AM

9, 9:00 AM

10, 10:00 AM

11, 11:00 AM

12, 12:00 PM

13, 1:00 PM

14, 2:00 PM

15, 3:00 PM

16, 4:00 PM

17, 5:00 PM

18, 6:00 PM

19, 7:00 PM

20, 8:00 PM

21, 9:00 PM

22, 10:00 PM

23,     11:00 PM];

1 Solution

Accepted Solutions
marcus_sommer

I think you don't need a mapping for it - a time(maketime([HOUR BLOCK])) should be enough.

- Marcus

View solution in original post

3 Replies
evan_kurowski
Specialist
Specialist

Hello Evan,


Not sure if you need an external mapping table to convert time components into a complete date/time.


Use the MakeTime() function:  =MakeTime(15,10,05)  

so, place your field which has the hour value into the function:

=MakeTime(MyHourField,0,0)

marcus_sommer

I think you don't need a mapping for it - a time(maketime([HOUR BLOCK])) should be enough.

- Marcus

evan_kurowski
Specialist
Specialist

Oh!  You went with Marcus's answer?!!  I had already worked out how to spend the points!!  (there was gonna be accolades, feting, shopping sprees, everything!!)

*thank you Marcus