Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
The #1 reason QlikView customers adopt Qlik Sense is a desire for a modern BI experience. Read More
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator III
Creator III

Background color

Hi i have two date fields..

Sno                    Start Date                                         End_Date                         Duration

  1            12-sep-2016 12:00:32 AM               12-sep-2016 12:00:52 AM               00 hr : 00 min : 20 sec

  2            12-sep-2016 02:20:02 PM               13-sep-2016 02:20:02 PM               24 hr : 00 min : 00 sec

  3            13-sep-2016 06:20:02 PM               13-sep-2016 08:20:02 PM               02 hr : 00 min : 00 sec

  4            13-sep-2016 06:20:02 AM               13-sep-2016 10:20:02 PM               16 hr : 00 min : 00 sec

Here, i want to display the background color as yellow which as duration of more than >10 hr between two given dates and  Green color for the duration < 10 hr

Thanks..

1 Solution

Accepted Solutions
Highlighted
Master III
Master III

Try this out -

script -

Duration expression -

only(Interval([End Date]-[Start Date],'hh:mm:ss TT'))


Background expression -

if(Duration>10/24,Yellow(),LightGreen())


Script

Load Sno,

  Timestamp#([Start Date],'DD-MMM-YYYY hh:mm:ss TT') as [Start Date],

  Timestamp#([End_Date],'DD-MMM-YYYY hh:mm:ss TT') as [End Date]

Inline [

Sno ,                  Start Date  ,                                      End_Date  

  1    ,        12-sep-2016 12:00:32 AM    ,          12-sep-2016 12:00:52 AM          

  2  ,          12-sep-2016 02:20:02 PM  ,            13-sep-2016 02:20:02 PM        

  3  ,          13-sep-2016 06:20:02 PM  ,            13-sep-2016 08:20:02 PM        

  4  ,        13-sep-2016 06:20:02 AM  ,            13-sep-2016 10:20:02 PM  ];

Capture.JPG

View solution in original post

5 Replies
Highlighted

Perhaps This

=If([Start Date] >= If(Match(Hour(Duration),'10 hr'),Duration),Yellow(),Green())

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Highlighted
Creator III
Creator III

No.. this is not working.. i am getting green color background fr all the rows..

Highlighted

Can you please post the application

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Highlighted
Master III
Master III

Try this out -

script -

Duration expression -

only(Interval([End Date]-[Start Date],'hh:mm:ss TT'))


Background expression -

if(Duration>10/24,Yellow(),LightGreen())


Script

Load Sno,

  Timestamp#([Start Date],'DD-MMM-YYYY hh:mm:ss TT') as [Start Date],

  Timestamp#([End_Date],'DD-MMM-YYYY hh:mm:ss TT') as [End Date]

Inline [

Sno ,                  Start Date  ,                                      End_Date  

  1    ,        12-sep-2016 12:00:32 AM    ,          12-sep-2016 12:00:52 AM          

  2  ,          12-sep-2016 02:20:02 PM  ,            13-sep-2016 02:20:02 PM        

  3  ,          13-sep-2016 06:20:02 PM  ,            13-sep-2016 08:20:02 PM        

  4  ,        13-sep-2016 06:20:02 AM  ,            13-sep-2016 10:20:02 PM  ];

Capture.JPG

View solution in original post

Highlighted
Creator III
Creator III

Thanks all for ur help