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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
ali_hijazi
Partner - Master II
Partner - Master II

Assigning a value to a variable from a sheet object

Hello
I'm new to QlickView
I'm using the following in my script
LET
vToday = makedate(2010,08,30)     ;
LET
vCurrentYear = Year (vToday)               ;
is there a way to LET vCurrentYear take a value from the selected item of a list box holding all available years?
I can walk on water when it freezes
1 Solution

Accepted Solutions
erichshiino
Partner - Master
Partner - Master

Yes,

Then you don't need to define it on the script.

You can go to setting-> Variable overview and create it there.

then the expression on the variable can be: (if your field is YEAR)

=YEAR

or

=ONLY(YEAR)

-> They work is the user can select only one year.

Other possibility is:

=max(YEAR) -> to get the max of the selected years

=max( {1} YEAR) -> to get max year independently of selection

or

=year(today()) -> to get the year considering the computer's calendar.

Hope it helps,

Erich

View solution in original post

1 Reply
erichshiino
Partner - Master
Partner - Master

Yes,

Then you don't need to define it on the script.

You can go to setting-> Variable overview and create it there.

then the expression on the variable can be: (if your field is YEAR)

=YEAR

or

=ONLY(YEAR)

-> They work is the user can select only one year.

Other possibility is:

=max(YEAR) -> to get the max of the selected years

=max( {1} YEAR) -> to get max year independently of selection

or

=year(today()) -> to get the year considering the computer's calendar.

Hope it helps,

Erich