Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
soniasweety
Master
Master

what is this expression do?

Hi all,

SubStringCount(

if( isnull(GetFieldSelections(Dim)),' ' , GetFieldSelections((Dim),'|',20))

, 'Quarter')

what is 20 here ?

can anyone explain this exp?

thanks

Sony

1 Solution

Accepted Solutions
sunny_talwar

Usually, when you use GetFieldSelections... depending on your user preferences (for instance mine are set at 6).. I will see a comma seperated list of selections up until 6 selections...

My user preference settings

Capture.PNG

6 selections

Capture.PNG

But as soon as I select 7... you will see what happens

Capture.PNG

Now in a lot of cases, this is not a problem, but when you have an adhoc report, you need to see the exact selection values so that you can equate them to a condition and conditionally hide show a dimension or expression....

In order to over-ride the user preferences... you can use the third parameter of the GetFieldSelections function...

Capture.PNG

But remember, this will only be good up until 20 selections... as soon as you make the 21st selection... you will see the same behavior like before

Capture.PNG

So, setting a highest possible number based on the number of unique value in your dimension might make sense here.

Does this help?

Best,

Sunny

View solution in original post

3 Replies
vishsaggi
Champion III
Champion III

20 represents max number of field values you can select from the field Dim.

Read more here:

https://help.qlik.com/en-US/qlikview/November2017/Subsystems/Client/Content/ChartFunctions/FieldFunc...

sunny_talwar

Usually, when you use GetFieldSelections... depending on your user preferences (for instance mine are set at 6).. I will see a comma seperated list of selections up until 6 selections...

My user preference settings

Capture.PNG

6 selections

Capture.PNG

But as soon as I select 7... you will see what happens

Capture.PNG

Now in a lot of cases, this is not a problem, but when you have an adhoc report, you need to see the exact selection values so that you can equate them to a condition and conditionally hide show a dimension or expression....

In order to over-ride the user preferences... you can use the third parameter of the GetFieldSelections function...

Capture.PNG

But remember, this will only be good up until 20 selections... as soon as you make the 21st selection... you will see the same behavior like before

Capture.PNG

So, setting a highest possible number based on the number of unique value in your dimension might make sense here.

Does this help?

Best,

Sunny

soniasweety
Master
Master
Author

thanks its very nice explanation .