Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I found below code from of the Community Question...
http://community.qlik.com/message/359002#359002
Can someone explain how below function work?
=if(GetSelectedCount(Product) and SubStringCount(Concat(distinct Product),Product),color(FieldIndex('Product',Product)))
Hi Manish,
=if(GetSelectedCount(Product) and SubStringCount(Concat(distinct Product),Product),color(FieldIndex('Product',Product)))
GetSelectedCount(Product) - Checks whether any product is selected in listbox
Concat(Distinct Product) - Concats all the selected values in Product listbox
SubStringCount(Concat(Distinct Product, Product) - Checks whether the product is exists in the concatenated string (output of Concat())
FieldIndex('Product',Product) - Will give the index number of the Product in the Product dimension
Color(FieldIndex('Product',Product)) - Will give the color code (RGB()) for the index number of the product value.
Finally, this expression is used to assign the Color to the Product in chart.
Hope this helps you.
Regards,
jagan.
Hi Manish,
=if(GetSelectedCount(Product) and SubStringCount(Concat(distinct Product),Product),color(FieldIndex('Product',Product)))
GetSelectedCount(Product) - Checks whether any product is selected in listbox
Concat(Distinct Product) - Concats all the selected values in Product listbox
SubStringCount(Concat(Distinct Product, Product) - Checks whether the product is exists in the concatenated string (output of Concat())
FieldIndex('Product',Product) - Will give the index number of the Product in the Product dimension
Color(FieldIndex('Product',Product)) - Will give the color code (RGB()) for the index number of the product value.
Finally, this expression is used to assign the Color to the Product in chart.
Hope this helps you.
Regards,
jagan.
Thanks Jagan
Great explanation !
I wish manuals written this way. But it's just a dream.
Thanks.