Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I'm trying to assign color mappings to different dimensions (Entity, Attribute and GenericRule) in the cycle group in a bar chart in Qlikview. I created mapping tables for all dimensions e.g.
Mapping LOAD
Attribute,
RGB(Red,Green,Blue) AS AttributeColor
(same for Entity and GenericRule)
I then used ApplyMap function to read them in:
LOAD
Attribute,
ApplyMap ('AttributeColorMap', Attribute, LightGray()) AS AttributeColor,
(same for Entity and GenericRule)
In Chart Properties -> Expressions under Background Color I put the following script, however I'm getting "Error in expression". Can someone please advise what I'm doing wrong here?
=if(GetCurrentField([Rules Dim Group])='Entity','EntityColor',
(if(GetCurrentField([Rules Dim Group])= 'Attribute','AttributeColor')),
(if(GetCurrentField([Rules Dim Group])='GenericRule','RuleColor')),
cdbAmber)
You want the value of the entity color field, not the text 'EntityColor'. Also the bracketing needs to be revised:
=if(GetCurrentField([Rules Dim Group])='Entity', EntityColor,
if(GetCurrentField([Rules Dim Group])= 'Attribute', AttributeColor,
if(GetCurrentField([Rules Dim Group])='GenericRule', RuleColor, cdbAmber)))
You want the value of the entity color field, not the text 'EntityColor'. Also the bracketing needs to be revised:
=if(GetCurrentField([Rules Dim Group])='Entity', EntityColor,
if(GetCurrentField([Rules Dim Group])= 'Attribute', AttributeColor,
if(GetCurrentField([Rules Dim Group])='GenericRule', RuleColor, cdbAmber)))
That worked perfectly. Thank you!
Another option could be a pick/ match combination
=Pick(
Match(GetCurrentField([Rules Dim Group]),'Entity','Attribute','Generic Rule')+1,
cdbAmber, //default value first
EntityColor,
AttributeColor,
RuleColor
)