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

Loading string value to a variable from table

Hi,

I would like to know how to store a field value i.e string in a variable.

Ex:

table:

id,name

1,aaa

2,bbb

3,ccc

how to load the filed values into a variable??

I tried peek function let vname = peek('name',0,'table')

but I didn't get any answer

If I keep id field instead of name I got result for id.

Please give the solution for this.

9 Replies
avinashelite

If I understand , you want to load the filed values into variable ...try this in front end

vname

=concat( distinct name, ';' )

Anonymous
Not applicable
Author

Hi mallika,

Try:

Let vname = peek(name,0,'table');

(without enclosing name in single quotes)

That should do the trick.

Anonymous
Not applicable
Author

I try this .but not getting answer

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You should use single quotes in the field name.

Let vname = peek('name',0,'table');

should work as long as table exists and has a field called name.

Can you post your script log?

-Rob

Anonymous
Not applicable
Author

Try This

=GetCurrentSelections(name )

jayshrinipurte
Partner - Creator
Partner - Creator

Hi Mallika,

Try to use FirstSorted Value Function....

Let vName = Firstsortedvalue(Name,0)

Regards,

Jayshri

Kushal_Chawda

what you want to achieve? If you can tell us your exact requirement, we can suggest some other ways

Anonymous
Not applicable
Author

its work fine

set vname=SubField(name,',');

regards

sahadev

Anonymous
Not applicable
Author

yes I got it.

Thank you