Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
femi_owoseni
Contributor III
Contributor III

Get field selection expression does not recognize assembled field name

Hi,

Does any know what the below expression isn't working.

=GetFieldSelections(SubField(mid(GetCurrentSelections('|'),Index(GetCurrentSelections('|'),'|',-1)+1),':',1))

It seems the GetFieldSelections does not recognize the resulting string from  SubField(mid(GetCurrentSelections('|'),Index(GetCurrentSelections('|'),'|',-1)+1),':',1) as a valid field name.

I tried appending '[' ']' or Chr(39) but no luck so far.

Thanks in advance

 

1 Solution

Accepted Solutions
sunny_talwar

May be give this a shot

=GetFieldSelections($(='[' & SubField(mid(GetCurrentSelections('|'), Index(GetCurrentSelections('|'), '|', -1) + 1),':',1) & ']'))

View solution in original post

8 Replies
sunny_talwar

May be try this

=GetFieldSelections($(=SubField(mid(GetCurrentSelections('|'), Index(GetCurrentSelections('|'), '|', -1) + 1),':',1)))
femi_owoseni
Contributor III
Contributor III
Author

Hi Stalwar1,

I got an invalid dimension error when I tried it

muthukumar77
Partner - Creator III
Partner - Creator III

Hi,

1. Create variable:

vGetFielsSelections : =chr(91)&SubField(mid(GetCurrentSelections('|'),Index(GetCurrentSelections('|'),'|',-1)+1),':',1)&chr(93)

2. Call that variable,

=GetFieldSelections($(vGetFielsSelections))

 

Muthukumar Pandiyan
sunny_talwar

May be give this a shot

=GetFieldSelections($(='[' & SubField(mid(GetCurrentSelections('|'), Index(GetCurrentSelections('|'), '|', -1) + 1),':',1) & ']'))
femi_owoseni
Contributor III
Contributor III
Author

Stalwar, Thank you very much. It worked. Can I trouble you to explain the modifications to my expression in particular why I needed to include $(...)

femi_owoseni
Contributor III
Contributor III
Author

Thanks I found a solution. But I will also try yours as well when I get the chance.

sunny_talwar

The inner expression, i.e.

SubField(mid(GetCurrentSelections('|'),Index(GetCurrentSelections('|'),'|',-1)+1),':',1)

Was giving a field name, but it was not read by GetFieldSelections as a field, but just a text. Using the dollar sign expansion, we told QlikView/Qlik Sense to interpret it as a field rather than just a random text. And the reason we needed [] is because you might have a field which had spaces... and QlikView/ Qlik Sense needs [] brackets for fields with spaces.

HTH

Best,
Sunny

femi_owoseni
Contributor III
Contributor III
Author

You are awesome. Thanks for your help.