Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone,
New Qlik Sense/ Qlik View user here.
I want to create a KPI, where the conditional coloring will filter based on two fields:
- EstArrivalTimeHrMinSec [Estimated time taken for an Ambulance to arrive at Incident scene (Predicted time)]
- TimeTakenforAmbulancetoArrive [Actual time taken for an Ambulance to arrive at Incident scene (Actual time)]
These two fields (fieldnames are in italics) are both formatted in Time('mm:ss') format for comparison, and I basically want to calculate:
- If Actual time taken < Estimated time taken
then I want the KPI to be displayed in GREEN (actual time for the ambulance to arrive is earlier than predicted, which is GOOD).
-If Actual time taken > Estimated time taken
then I want the KPI to be displayed in RED(actual time taken is later than predicted, which is BAD).
I have already tried creating a conditional coloring in a KPI object on my own, and here is my expression:
=If(Time(avg({$}TimeTakenforAmbulancetoArrive), 'mm:ss') < Time(avg({$}EstArrivalTimeHrMinSec), 'mm:ss'), Time(avg({$}TimeTakenforAmbulancetoArrive), 'mm:ss'), Time(avg({$}EstArrivalTimeHrMinSec), 'mm:ss'))
Sometimes the conditional coloring will work, sometimes it wouldn't, and I don't know what exactly I'm doing incorrectly with my expression. I have attached a snapshot below regarding the issue.
When the expression sometimes works (time displayed correctly as GREEN)
When the expression doesn't work (time should display as GREEN instead of RED)
Please help! Thanks in advance.
Equation seems worked. Can you share QVF file to test rather discuss on fly
I can share the .qvf file with you, but it draws data from a local data connection, and I don't think the sheet will run properly without the data. I am not able to give you the data though, unfortunately as it is confidential.
Is there another way I could pass you the file? Perhaps making a sample subset of my data?