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

AM PM flag by minute of day

Hello,

I am trying to group buckets of minutes into AM and PM categories.  Creating the table below gives me the flags I was hoping for but when I try to use this flag as a dimension it is giving me duplicate values for AM and PM.  How can I create a distinct dimension grouping for this flag?

LOAD DISTINCT MinuteOfDay,Time(MinuteOfDay,'TT') as AMPMFLAG

RESIDENT MOD;

1 Solution

Accepted Solutions
juraj_misina
Luminary Alumni
Luminary Alumni

Hi,

Time(MinuteOfDay,'TT') will only change format of the value, but not the underlying numeric value itself, therefore you see duplicates. However, you can convert it to text, to strip numeric value:

Text(Time(MinuteOfDay,'TT')) as AMPMFLAG

Hope this helps.

Juraj

View solution in original post

2 Replies
juraj_misina
Luminary Alumni
Luminary Alumni

Hi,

Time(MinuteOfDay,'TT') will only change format of the value, but not the underlying numeric value itself, therefore you see duplicates. However, you can convert it to text, to strip numeric value:

Text(Time(MinuteOfDay,'TT')) as AMPMFLAG

Hope this helps.

Juraj

andrewmo
Creator
Creator
Author

That did the trick.  Thanks much Juraj!