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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
jagannalla
Partner - Specialist III
Partner - Specialist III

SelectField with different data in actions

Hi,

- If one of the field of qvd file contains like :

A

10

20

30

40

50

- We can write in button action for field like this if varibale contains the data (vA=10).

SeletedField(A) & value=$(vA)

Capture.PNG

- But if variable contains data like this vA=10,20,30. How can we implement of SelectedField with this data.

1 Solution

Accepted Solutions
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

    Try this  expression in your search string.

    =Replace('('&Variable2&')',',','|')

    The reason is when you want to search more than one value you should include those value in this form (10|40)

    and the above expression will give you the string in this format.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!

View solution in original post

8 Replies
Not applicable

Hi,

     You may like to use the subfield() function, or, use exists() function alongwith fieldvalue() function to retrieve the value. Depends on what selections you make and what your expected output should be.

Thanks.

jagannalla
Partner - Specialist III
Partner - Specialist III
Author

Hi,

The think is i've a table box with fields A,B,C and for field A i've data as i said before.

For Eg:

A with data(10,20,30,40.......)

- I'm storing the value 30 in vA variable.

- Now i wriiten in button action with SelectionField and with value for the field.

For Eg:

Capture1.PNG

- And when i click the button i can see in the table with data of 30  in the column A.

- Now i will store in the variable vA with data (10,40).

- When i click the button i should see in the table box with 10,40 in the column A along with other fields of table box.

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

    Try this  expression in your search string.

    =Replace('('&Variable2&')',',','|')

    The reason is when you want to search more than one value you should include those value in this form (10|40)

    and the above expression will give you the string in this format.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
jagannalla
Partner - Specialist III
Partner - Specialist III
Author

Thanks a lot kaushik..It's working

jagannalla
Partner - Specialist III
Partner - Specialist III
Author

- I've small doubt. I've a field A with data 10,20,30.

- When i written in button action with selectedfield and value as 20|30 why it is not working..

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

    It should be in brackets. i.e (20|30)

Regards,

Kaushik Solanki 

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
jagannalla
Partner - Specialist III
Partner - Specialist III
Author

Ok Thanks a lot..

jagannalla
Partner - Specialist III
Partner - Specialist III
Author

Hi,

I need a help from you once again. When we have string or string with space in the column the above code is not working. Let me know what can i do.

Eg of my data is

Column1

A

B 1

C 2

C (cs1)

If i apply selectioninfield for column1 iwth code (A|B 1||C (cs1)) it is not working.