Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
toddbuss
Creator
Creator

set analysis with RGB table

In an expression color code field that chooses a color from a table, I want to pick the color value that corresponds with the latest record.

I was thinking I need to use set analysis, but don't really need aggregation.  I tried using max, avg, etc with this set:

max({$<ReportDate={"$(=max(ReportDate))"}>}[Multi Bunk Status Color])

I think the problem is that RGB values (strings) can't be aggregated.  Here's what's loaded into [Multi Bunk Status Color]...

[Multi Bunk Status Table]:

load * Inline

["Multi Bunk Status","Multi Bunk Status Color"

'1VACANT','RGB(153,255,51)'

'2VACANT','RGB(255,255,51)'

'4VACANT','RGB(255,0,0)'

'1FILLED','RGB(76,153,0)'

'2FILLED','RGB(153,153,0)'

'4FILLED','rgb(153,0,0)'

];

Thanks.

1 Solution

Accepted Solutions
rupamjyotidas
Specialist
Specialist

Did you tried with Only

Only(Distinct {$<ReportDate={"$(=max(ReportDate))"}>}[Multi Bunk Status Color])

View solution in original post

2 Replies
rupamjyotidas
Specialist
Specialist

Did you tried with Only

Only(Distinct {$<ReportDate={"$(=max(ReportDate))"}>}[Multi Bunk Status Color])

toddbuss
Creator
Creator
Author

Only is the only function I needed.  Thanks.