Expand my Community achievements bar.

SOLVED

compare columns and put in colours

Avatar

Level 2

HI Team! Trying to compare 2 Duration columns in a Task report. 
Original Duration (task)  VS. Duration (task) 

Both ive got in Days and i would really like it to give me a colour if the date in the Duration column is Greater than the days in the Original Duration column. 

Screenshot 2025-01-17 170047.png

 I have tried and failed with syntax. any help would be fab thanks! 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Level 2

Ok so i took a bunch from another report. Here is a final system to make backgrounds colour coded. 
Less than = green, Equals = yellow, Greater than = red. 

descriptionkey=durationMinutes
displayname=
durationunitfield=durationUnit.value
linkedname=direct
listsort=intAsInt(durationMinutes)
namekey=duration
querysort=durationMinutes
styledef.case.0.comparison.icon=false
styledef.case.0.comparison.leftmethod=intAsInt(durationMinutes)
styledef.case.0.comparison.operator=gt
styledef.case.0.comparison.operatortype=int
styledef.case.0.comparison.rightmethod=intAsInt(originalDuration)
styledef.case.0.comparison.trueproperty.0.name=textcolor
styledef.case.0.comparison.trueproperty.0.value=000000
styledef.case.0.comparison.trueproperty.1.name=bgcolor
styledef.case.0.comparison.trueproperty.1.value=eac6c9
styledef.case.0.comparison.truetext=
styledef.case.1.comparison.icon=false
styledef.case.1.comparison.leftmethod=intAsInt(durationMinutes)
styledef.case.1.comparison.operator=eq
styledef.case.1.comparison.operatortype=int
styledef.case.1.comparison.rightmethod=intAsInt(originalDuration)
styledef.case.1.comparison.trueproperty.0.name=bgcolor
styledef.case.1.comparison.trueproperty.0.value=feecc8
styledef.case.1.comparison.truetext=
styledef.case.2.comparison.icon=false
styledef.case.2.comparison.leftmethod=intAsInt(durationMinutes)
styledef.case.2.comparison.operator=lt
styledef.case.2.comparison.operatortype=int
styledef.case.2.comparison.rightmethod=intAsInt(originalDuration)
styledef.case.2.comparison.trueproperty.0.name=bgcolor
styledef.case.2.comparison.trueproperty.0.value=def6e2
styledef.case.2.comparison.truetext=
textmode=true
valuefield=durationMinutes
valueformat=compound
viewalias=duration

Thanks both! couldnt have got there without you! 


View solution in original post

5 Replies

Avatar

Community Advisor

Hi,

 

Give the following text mode a try:

 

descriptionkey=durationMinutes
durationunitfield=durationUnit.value
linkedname=direct
listsort=intAsInt(durationMinutes)
namekey=duration
querysort=durationMinutes
styledef.comparison.leftmethod=intAsInt(durationMinutes)
styledef.comparison.operator=gt
styledef.comparison.operatortype=int
styledef.comparison.rightmethod=intAsInt(originalDuration)
styledef.comparison.truetext=font-weight:900;color:#990000;
textmode=true
valuefield=durationMinutes
valueformat=compound

 

This text mode should return the duration field as days in bold red if it is greater than the originalDuration field.

 

Best Regards,

Rich.

Avatar

Community Advisor

There is some documentation on this to support Richard's answer. Compare fields in conditional formatting | Adobe Workfront

 

 

@NicholeVargas  - I think you did a tutorial on this for a community event. Do you know the link for that? 




Avatar

Level 2

HI Both thank you for these links!! Great work! 

Richard is there a way to make the Background Red instead of the text? 

going to play around and see if i can get it have a secondary comparison for Less than. Which im hoping will be similar syntax but with "lt"? and a diff colour. 

thanks both! 

Avatar

Correct answer by
Level 2

Ok so i took a bunch from another report. Here is a final system to make backgrounds colour coded. 
Less than = green, Equals = yellow, Greater than = red. 

descriptionkey=durationMinutes
displayname=
durationunitfield=durationUnit.value
linkedname=direct
listsort=intAsInt(durationMinutes)
namekey=duration
querysort=durationMinutes
styledef.case.0.comparison.icon=false
styledef.case.0.comparison.leftmethod=intAsInt(durationMinutes)
styledef.case.0.comparison.operator=gt
styledef.case.0.comparison.operatortype=int
styledef.case.0.comparison.rightmethod=intAsInt(originalDuration)
styledef.case.0.comparison.trueproperty.0.name=textcolor
styledef.case.0.comparison.trueproperty.0.value=000000
styledef.case.0.comparison.trueproperty.1.name=bgcolor
styledef.case.0.comparison.trueproperty.1.value=eac6c9
styledef.case.0.comparison.truetext=
styledef.case.1.comparison.icon=false
styledef.case.1.comparison.leftmethod=intAsInt(durationMinutes)
styledef.case.1.comparison.operator=eq
styledef.case.1.comparison.operatortype=int
styledef.case.1.comparison.rightmethod=intAsInt(originalDuration)
styledef.case.1.comparison.trueproperty.0.name=bgcolor
styledef.case.1.comparison.trueproperty.0.value=feecc8
styledef.case.1.comparison.truetext=
styledef.case.2.comparison.icon=false
styledef.case.2.comparison.leftmethod=intAsInt(durationMinutes)
styledef.case.2.comparison.operator=lt
styledef.case.2.comparison.operatortype=int
styledef.case.2.comparison.rightmethod=intAsInt(originalDuration)
styledef.case.2.comparison.trueproperty.0.name=bgcolor
styledef.case.2.comparison.trueproperty.0.value=def6e2
styledef.case.2.comparison.truetext=
textmode=true
valuefield=durationMinutes
valueformat=compound
viewalias=duration

Thanks both! couldnt have got there without you! 


Avatar

Employee Advisor

There is also the option of comparing two fields using a filter, so that you don't have to use conditional formatting - just an idea. See Tip #3 from the 10 Text Mode Tips workshop

You can download the slide deck from that link and watch the on-demand recording (tip #3 starts at the 21-minute mark)