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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Read a text field and store it into a variable

Hi,

Is it possible to read a field which is text from a table and store the text value into a variable that can be used later?

Say the field is called “FiscalYear” and it contains this data “2016-2017”.   How would I do this?   Many of the examples I see

deal with numeric fields to be used with functions like SUM(), AGGR() and etc. 

Thanks!

16 Replies
giakoum
Partner - Master II
Partner - Master II

use the fieldvalue function

sunny_talwar

Store while reloading or on the front end?

giakoum
Partner - Master II
Partner - Master II

or the peek function

Anonymous
Not applicable
Author

I need to store the value while doing a LOAD ... from my SQL Server table.

Would you kindly include some code sample?

avinashelite

could please explain how you need to use this with an example ??

sunny_talwar

May be like this:

LOAD MaxString(FiscalYear) as Max

Resident Table;

LET vMaxFiscalYear = Peek('Max');

miguelbraga
Partner - Specialist III
Partner - Specialist III

Hey there,

It is possible to insert a text in a input box that will overwrite a variable and then use that variable in a TextBox and every object you want. Hope this makes it clear

Best regards,

D.A. MB

Anonymous
Not applicable
Author

Sunny,

I followed your code.  When I displayed the variable vMaxFiscalYear in a text object like:

= $(vMaxFiscalYear )

The text label shows a value of "2001".  My actual data is "2017-16".  What am I missing?

qv9.jpg

sunny_talwar

What happens when you use this: vMaxFiscalYear (Without dollar sign expansion?)