Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Stars
Creator
Creator

Can GetFieldSelections return data as VALUES instead of STRINGS

I'm sure this is a basic mistake, but I cannot figure it out!

 

I'm trying to highlight a row in my table a certain color.

Right now I'm using this:

if(YearID = '34','#ff3333','#ffffff')

It works perfectly.  However, I want my equation to be based on whatever YearID is selected in a dropdown menu.  HOW do I do that?

I had:

if(YearID = GetFieldSelections(YearID),'#ff3333','#ffffff')

but it doesn't work.  I assume it's something about the yearID being seen as a number vs a selection, but I'm not sure.  Any suggestions?  I think it's reading the '34' in the first equation as a string, isn't it?  So shouldn't this still work?  I'm lost.  Usually I can use variables as a workaround, but I can't here.

Thank you!

2 Replies
PradeepK
Creator II
Creator II

If you are filtering via drop-down.. then all rows in the table should be reduced to selected field values.

You can directly use below expression in background color expression.. Why do you want to find exact selected values ?

 

if( GetSelectedCount(YearID) > 0,'#ff3333')

 

In case, you are restricted to so. .and only want to find it by comparison; Use below condition in if statement

WildMatch( '$(=GetFieldSelections(YearID))','*$(YearID)*') = 1

 

morgankejerhag
Partner - Creator III
Partner - Creator III

This can be solved in many ways. If you let the user make a selection on YearID the data is filtered to only show that YearID. It can be better to have a variable input instead and let the user make the "selection" there.

if(YearID=$(vYearID),'#ff3333','#ffffff')

So add a variable vYearID and add a variable input. you can have the user make a selection from the options that are available in the YearID field by setting the input to dynamic and generating a list of the values using concat().

Morgan Kejerhag
Senior Business Intelligence Consultant
Drake Analytics
http://www.drakeanalytics.se