Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Highlighting expression columns

Hello,

After the group here helped solve this issue for me - First Selected Value - Second, Third, Fourth, etc values I have run into a new question.  When we pull in shift records, we have a unique key that is created (ShiftKey) that is a combination of the employee ID and the date the shift started since the same person can't be signed up for two shifts that start in one day.  We use the shift key to match up their shift history records and their training evaluation records.  When we display a person's shift records, we want to conditionally highlight the text of the shift date based on whether that shift's evaluation was the trainee was on track of off track.

Off Track - Red

On Track - Green

No Status - Blue

I have tried to get this to work either through the Text Color options on the Shift (X) expression.  I think the issue is that since ShiftDate or ShiftKey are not dimensions in the chart, it isn't able to reliably link the shift date to the evaluation of that shift:

=if(num(Min({<Shift_ShiftTypeName={'Trainee'}>}Shift_StartDateTime,1)=num(min(Shift_Date),1)),

(if(Left(On_Track_Status,3)='Not',LightRed(),

if(Left(On_Track_Status,2)='On',LightGreen(),

if(IsNull(On_Track_Status)>0,LightBlue())))))

Also tried:

=if(num(Min({<Shift_ShiftTypeName={'Trainee'}>}Shift_StartDateTime,1)),

(if(Left(On_Track_Status,3)='Not',LightRed(),

if(Left(On_Track_Status,2)='On',LightGreen(),LightBlue()))))

And:

=if(Left(On_Track_Status,3)='Not',LightRed(),

if(Left(On_Track_Status,2)='On',LightGreen(),LightBlue()))


Training Evaluation Table

ScheduledShiftDateShiftKeyOnTrackStatus
4253710968_42537On Track
4254410968_42544Off Track
4255110968_42551On Track

Shift History Table

ShiftDate

ShiftKey
4253710968_42537
4254410968_42544
4255110968_42551
4255910968_42559

Expected Output

EEIDShift 1Shift 2Shift 3Shift 4Shift 5
1096842537425444255142559

I have tried joining the Evaluation History table to the Shift History table, but that didn't get me very far.

This is what I currently see, even though there are no Status records for the shifts that haven't occurred yet - the shifts are still highlighting due to the expression above.

shift_tracking.JPG

Thank you for the assistance!

Phil

14 Replies
Anonymous
Not applicable
Author

Any ideas after my last post?  This seems to work fine if I make it out of a pivot table and Shift Date is across the top.  The problem with that direction is that when your table shows 50 people and shifts span a 3 month time frame, there are ~90 columns in the table for all the various possibilities.

Thank you

vinieme12
Champion III
Champion III

Don't  Left Join to your Employee Table, Do a Crosstab load of your Shifttable so all your shift details are in one column.

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
vinieme12
Champion III
Champion III

can you post an excel sample to show how your data tables look like

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Anonymous
Not applicable
Author

I was able to figure it out using this code:

=Pick(Wildmatch(FirstSortedValue({<Shift_ShiftTypeName={'Trainee'}>}On_Track_Status,Shift_StartDateTime,1),'Not*','On*'),LightRed(),LightGreen())

Switching the offset number based on the shift # did the trick.

Thank you for the help!

Anonymous
Not applicable
Author

Hi Phillip,

We're glad to hear you were able to figure out your solution. Please take a moment to mark a few replies as Helpful to give points to those who assisted. See this document for more information on this: Qlik Community Tip: Marking Replies as Correct or Helpful

Best,

Qlik Community Team