Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

toddbuss
New Contributor III

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
Valued Contributor

Re: set analysis with RGB table

Did you tried with Only

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

2 Replies
rupamjyotidas
Valued Contributor

Re: set analysis with RGB table

Did you tried with Only

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

Highlighted
toddbuss
New Contributor III

Re: set analysis with RGB table

Only is the only function I needed.  Thanks.

Community Browser