Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

compare time instruction IF

Hello
I am new to the forum, I need help, I have a table of two fields name and arrival time, I will wish to display all persons arriving from 7am: 45 red and one in green.

example

Header 1

Header 2

pat

05:45

nav

07:00

be

07:45

Hugues

10:50

but I do not know how to put in my expression
But I thought the  
If...Then...Else Statement,
rgb(255,255,255), rgb(0,255,0),hour(7),minute(45)

1 Solution

Accepted Solutions
swuehl
MVP
MVP

First, make sure that you've read in the time field correctly:

http://community.qlik.com/blogs/qlikviewdesignblog/2012/06/07/get-the-dates-right

Then, you can create a straight table chart with field 'name' as dimension and

=only([arrival time])

as expression, assuming one arrival time per name value.

Then you've got two options for colour the expression:

Either use the old-style visual cues tab in chart properties, and enter an expression like

maketime(7,45)

in the entry field for upper and lower limit (chosing an appropriate colour also).

VisualCue1.png

Or, second option, use a Text Color attribute expression in expression tab:

VisualCue1.png

Expression could look like

=if( [arrival time] >= maketime(7,45), lightred(), lightgreen() )

View solution in original post

2 Replies
swuehl
MVP
MVP

First, make sure that you've read in the time field correctly:

http://community.qlik.com/blogs/qlikviewdesignblog/2012/06/07/get-the-dates-right

Then, you can create a straight table chart with field 'name' as dimension and

=only([arrival time])

as expression, assuming one arrival time per name value.

Then you've got two options for colour the expression:

Either use the old-style visual cues tab in chart properties, and enter an expression like

maketime(7,45)

in the entry field for upper and lower limit (chosing an appropriate colour also).

VisualCue1.png

Or, second option, use a Text Color attribute expression in expression tab:

VisualCue1.png

Expression could look like

=if( [arrival time] >= maketime(7,45), lightred(), lightgreen() )

Not applicable
Author

Thank swuehl you it works