Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Color Change based on selections

Hi,

I want the color of the bar graph to be changed based on the selections.

If selected Underwriter(As per my chart) then it has to come in blue. If selected underwriter's value is less than average then it should be red.

If its more than average it should be in green.

I have attached a qvw file.

Everything works fine when its selected but by default its not coming green.

vAverage and vUnderwriter are the variables used.

I am new to qlikview please reply ASAP

Thanks in adavnce

Soumya

1 Solution

Accepted Solutions
menta
Partner - Creator II
Partner - Creator II

Ok sorry for delay:

i think this can be a solution

if(substringcount( Concat(GetFieldSelections([Underwriter supplying the information]),' '),[Underwriter supplying the information] ) >0,Blue(),

if((sum({<[Underwriter supplying the information],Limit_TradeSector,[Current Aon Branch]= >}[Amount Approved GBP]))>$(vAverage),Green(),

If((sum({<[Underwriter supplying the information],Limit_TradeSector,[Current Aon Branch]= >}[Amount Approved GBP]))<$(vAverage),red(),Blue()))

)

View solution in original post

14 Replies
israrkhan
Specialist II
Specialist II

not connected to qlikview, so could not open the file,

but have you mention the else part..

like

if(GetFieldSelection(Field)='Underwriter',Blue, if(Underwriter <= 100,Red(),Green()),White())

saumyashah90
Specialist
Specialist

please use this and check

Please check variable definition also

Every time you need not use set analysis

menta
Partner - Creator II
Partner - Creator II

You can try this

if([Underwriter supplying the information]=GetFieldSelections([Underwriter supplying the information]),blue(),

if((sum({<[Underwriter supplying the information],Limit_TradeSector,[Current Aon Branch]= >}[Amount Approved GBP]))>$(vAverage),Green(),

If((sum({<[Underwriter supplying the information],Limit_TradeSector,[Current Aon Branch]= >}[Amount Approved GBP]))<$(vAverage),red(),Blue()))

)

Not applicable
Author

Hi Carlo,

Thank u so much

This expression works when only one field is selected. What if more than one field is selected.

Please send an expression for it.

Thanks in advance

Soumya

Not applicable
Author

Hi Carlo,

This expression works only when one field is selected.

What if multiple fields are selected.

Could you share the expression for multiple field selections.

Regards,

Keerthi

menta
Partner - Creator II
Partner - Creator II

Ok sorry for delay:

i think this can be a solution

if(substringcount( Concat(GetFieldSelections([Underwriter supplying the information]),' '),[Underwriter supplying the information] ) >0,Blue(),

if((sum({<[Underwriter supplying the information],Limit_TradeSector,[Current Aon Branch]= >}[Amount Approved GBP]))>$(vAverage),Green(),

If((sum({<[Underwriter supplying the information],Limit_TradeSector,[Current Aon Branch]= >}[Amount Approved GBP]))<$(vAverage),red(),Blue()))

)

Not applicable
Author

Thanks a lotttttttt Carlo

Not applicable
Author

Hi Carlo,

Its showing in blue(Selected ones) only for first 6 selections later if we select its showing default colors.

What might be the reason for it ?

Regards,

keerhti

menta
Partner - Creator II
Partner - Creator II

6 is the default value for getfieldselections you can change this part into

Concat(GetFieldSelections([Underwriter supplying the information],'',15)

15 is an example you can write your value.