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

Load a field as single value for variable, how to hard code it?

Hi community, 

I load a field as a single value in the script and and use it as the value for a variable to use in set analysis.  The field only has one value but since I load other tables, sometimes the field value is not selected and the variable has no value.  Is there anyway to hard code the value in the field so that it is what it is regardless of selection?

1 Solution

Accepted Solutions
Not applicable
Author

Yes I figured it out.  You have to use set analysis in the variable definition like:

=only({1}[Current Fiscal Week])

View solution in original post

2 Replies
Not applicable
Author

Yes I figured it out.  You have to use set analysis in the variable definition like:

=only({1}[Current Fiscal Week])

Not applicable
Author

I did something like that once, I read a date from a file and save it into variables and then I could use it on the final reports, what I did was:

//source

LastDateFile:

LOAD Date as LastDate

FROM

File.txt

(txt, codepage is 1252, embedded labels, delimiter is '\t', msq);

//Variables:

let vDateExt = date(peek('LastDate',0,'LastDateFile'));

let vDay = Day(vDateExt);

let vMonth = Month(vDateExt);

let vYear = Year(vDateExt);

Regards!