Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Using Traffic Light Gauge with Date

Hello Qlik Users,

I have scrolled through all discussion on this topic but none have been able to explain how date can be used with traffic light.

traffic light.png

I have above data where I am trying to create a "single traffic light gauge" for date field. I have created "due date" as expression and named it as "traffic".

I want red light if "due date" is more than today's date and green otherwise.

What script should I add in below segment settings.

traffic light1.png

1 Solution

Accepted Solutions
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

HI, Here is the solution.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!

View solution in original post

7 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

HI,

     Create a field in data model which is a difference between the due date and today.

     Once you get this field, then use this field to get the traffic signal light.

     If possible post the sample data.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Here is the qvw file.

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Rahul,

Kindly reload the application.

Cause it shows the script but no data.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Here is the data...

Ok, I followed above instruction now i can see red light but no green light..I have given lower bound as 0 for segment 1.

For traffic field i used formula as = today() - "due date"

traffic light2.png

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

HI, Here is the solution.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Thanks Kaushik..It worked, just had to fine tune the gauge setting.

MarcoWedel

Hi,

too late but maybe also helpful:

QlikCommunity_Thread_167278_Pic1.JPG

QlikCommunity_Thread_167278_Pic2.JPG

QlikCommunity_Thread_167278_Pic3.JPG

regards

Marco