Skip to main content
Solved

Hi all, I want to create a dropdown in views of the hours in a day, but my dropdown shows multiple values for each dropdown.

  • April 16, 2024
  • 3 replies
  • 19 views

koert.kritz11
Level 4
Forum|alt.badge.img+6

imageHere is the code: ROUND_HOUR( "ITT_PRODUCTIVITY_F_SEP_UAT"."EVENTTIME" )

Best answer by Sverre Klein

Hi @koert.kritz11,

 

There is an easy & alternative but, let's say, more ugly way that has worked for me in the past.

 

Instead of using ROUND_HOUR, use HOURS, this returns the integer value of the hour. For instance, 14:00 becomes 14.

 

It returns the dropdown like this and acts as a time filter appropriately.

image 

Let me know if this is sufficient for you 😄

 

Kind regards,

Sverre Klein

3 replies

Sverre Klein
Level 10
Forum|alt.badge.img+14
  • Level 10
  • Answer
  • April 16, 2024

Hi @koert.kritz11,

 

There is an easy & alternative but, let's say, more ugly way that has worked for me in the past.

 

Instead of using ROUND_HOUR, use HOURS, this returns the integer value of the hour. For instance, 14:00 becomes 14.

 

It returns the dropdown like this and acts as a time filter appropriately.

image 

Let me know if this is sufficient for you 😄

 

Kind regards,

Sverre Klein


koert.kritz11
Level 4
Forum|alt.badge.img+6

Hi @koert.kritz11,

 

There is an easy & alternative but, let's say, more ugly way that has worked for me in the past.

 

Instead of using ROUND_HOUR, use HOURS, this returns the integer value of the hour. For instance, 14:00 becomes 14.

 

It returns the dropdown like this and acts as a time filter appropriately.

image 

Let me know if this is sufficient for you 😄

 

Kind regards,

Sverre Klein

Thank you @sverre.klein11 , it works perfectly!


dennis.pflug
Level 10

in combination with a concat you can make its look even better readable:

 

HOURS( "ITT_PRODUCTIVITY_F_SEP_UAT"."EVENTTIME" ) || ':00'

This way you will get your values like 14:00

 

BR

Dennis