Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Greetings Community,
I am in need of some expertise. I have a table that has four categories of completion status (Did Not Attend, Not Completed, Completed, and Partially Completed) that I am trying to color code to show red for did not attend, yellow, for not completed, green for completed, and gray for partially completed. The issue is I tried doing an IF statement putting commas in between each statement and I get nothing back. I tried writing it with just for the red and it worked. Everything else it would do nothing. Please help.
Hello @Anonymous ,
Thanks for posting.
On the Background color expression of the field have you put something like:
if(AsciiNum = 32, red(),
if(AsciiNum = 33, yellow(),
if(AsciiNum = 34, green(),
if(AsciiNum = 35, black(),
white()
)
)
)
)
For you should be like:
if([Completion Status] = 'Did Not Attend', red(), if([Completion Status] = 'Not Completed', yellow(), if([Completion Status] = 'Completed', green(), if([Completion Status] = 'Partially Completed', lightgray(), white() ) ) ) )
The following color functions can be used in expressions when coloring by expression.
Cheers,
Albert
Using this data:
CompletionStatus:
load * Inline [
Row,CompletionStatus
1,Not Completed
2,Completed
3,Completed
4,Completed
5,Not Completed
6,Completed
7,Not Completed
8,Partially Completed
9,Did Not Attend
10,Completed
];
This formula in the "Background color express"
=If(CompletionStatus = 'Did Not Attend',Red(),
If(CompletionStatus = 'Not Completed', Yellow(),
If(CompletionStatus = 'Completed',Green(),
If(CompletionStatus = 'Partially Completed',rgb(105,105,105)))))
Thank you for the assistance Albert. I discovered where I went wrong when doing my if statements is that I did not include the () after my colors. --Cheers
Great @Anonymous , glad we could help!
Hello @Anonymous ,
Thanks for posting.
On the Background color expression of the field have you put something like:
if(AsciiNum = 32, red(),
if(AsciiNum = 33, yellow(),
if(AsciiNum = 34, green(),
if(AsciiNum = 35, black(),
white()
)
)
)
)
For you should be like:
if([Completion Status] = 'Did Not Attend', red(), if([Completion Status] = 'Not Completed', yellow(), if([Completion Status] = 'Completed', green(), if([Completion Status] = 'Partially Completed', lightgray(), white() ) ) ) )
The following color functions can be used in expressions when coloring by expression.
Cheers,
Albert
Using this data:
CompletionStatus:
load * Inline [
Row,CompletionStatus
1,Not Completed
2,Completed
3,Completed
4,Completed
5,Not Completed
6,Completed
7,Not Completed
8,Partially Completed
9,Did Not Attend
10,Completed
];
This formula in the "Background color express"
=If(CompletionStatus = 'Did Not Attend',Red(),
If(CompletionStatus = 'Not Completed', Yellow(),
If(CompletionStatus = 'Completed',Green(),
If(CompletionStatus = 'Partially Completed',rgb(105,105,105)))))
Thank you for the assistance Albert. I discovered where I went wrong when doing my if statements is that I did not include the () after my colors. --Cheers
Great @Anonymous , glad we could help!