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: 
marco_puccetti
Partner - Creator
Partner - Creator

Peek in TextBox

Hello, when i try to use this function: =peek('PRODOTTO', 1,'FATTI') in a TextBox or in a Variable, the sintax checker return error.

Is there anything i have done wrong?

PRODOTTO is the field, 1 is the record and FATTI is the table.

Thanks

17 Replies
marco_puccetti
Partner - Creator
Partner - Creator
Author

I have tried with this: Let m_Prod = peek('PRODOTTO', 0,'FATTI');

and debugging the script it returns the first data of the column PRODOTTO (that is prod A), but if i insert the $(m_Prod) in the text field it will return this error: "Error Garbage after expression: A".

Can you help me?

Thanks

sunny_talwar

What happens when you put =m_Prod (without the $ and parenthesis) in a text object?

marco_puccetti
Partner - Creator
Partner - Creator
Author

It works, but is not always necessary the $ expansion before each variable reading?

Thanks

marcus_sommer

The suggestion from anbu cheliyan worked if you need to access distinct fieldvalues. If you need to access a fieldvalue from a certain table-record you need to extend these table with a rowno() ID which you then could use within the expression:

only({< RowNoID = {1}>} PRODOTTO)

- Marcus

sunny_talwar

Nope, $() is used when you have to evaluate a variable. If you just need the value from the variable without evaluating it, you don't use $().

In your case, when you used Peek function it spits out a value which can then be used without the $().

Best,

S

marco_puccetti
Partner - Creator
Partner - Creator
Author

Can you make me some examples?

Thanks!!

sunny_talwar

Look at the attached qvw. You might find this helpful.

Note: there are two variables and both will give you different result for with and without $()

HTH

Best,

S

marco_puccetti
Partner - Creator
Partner - Creator
Author

Thanks

Marco