Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
ivan_will
Partner - Creator II
Partner - Creator II

How to take a string value as a variable using peek or another function?

Hi, I need to take a value from a filed in a table - The field has only one value. But when use peek with string value/filed it doesn't work !!! When the filed RRR is a number it works .... So how to take RRR as a variable (neede_value)?

check:

load

'dfl;ids aofd apiajovdskmdsf wp'oqr0932904w-93q e-0ewriufd' as RRR

resident main_check;

let needed_value = peek ( 'RRR' , 0 , 'check') ;



1 Solution

Accepted Solutions
ivan_will
Partner - Creator II
Partner - Creator II
Author

Just using FieldValue('field',number of position in the fiield)

🙂

View solution in original post

6 Replies
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Peek() works equally well with strings and numbers... In your example, you have a single quote in the middle of your string. I think your load statement should fail even before the peek() function...

ivan_will
Partner - Creator II
Partner - Creator II
Author

OK , I have replaced the quote and the spaces and even doesn't work !!! Any solution ... ?

johnw
Champion III
Champion III

Working example attached. Script below.

LOAD 'Test String' as String AUTOGENERATE 1;
LET Variable = peek('String');

ivan_will
Partner - Creator II
Partner - Creator II
Author

Thanks,

But I have to take the text from a table !

Can't manage how to do it...

johnw
Champion III
Champion III


ivan_will wrote:But I have to take the text from a table !


Yes, understood. I generated a table. I took the text from it. What do you want me to use if not an autogenerated table? Would you be more convinced by an inline load? More rows in the table? It doesn't matter. It still works.

ivan_will
Partner - Creator II
Partner - Creator II
Author

Just using FieldValue('field',number of position in the fiield)

🙂