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: 
hykal1993
Contributor II
Contributor II

How do I create a Variable then Call It Again

Hi,

I want to creat a variable and then later would like to call it later like below:

LOAD

MonthName(‘9/1/2018’) as [Sample Month]

;

LOAD

....

....

[Open Date],

....‌

if(year([Open Date] )= year ([Sample Month]), ‘Yes’, ‘No’) as [V1]

From

[folder path]

but error says sample month is not found. How do I fix this

3 Replies
Sergey_Shuklin
Specialist
Specialist

Hello!

Peek() function is exactly what you should use in such cases:

https://help.qlik.com/en-US/qlikview/November2017/Subsystems/Client/Content/Scripting/InterRecordFun...

Also I've attached a little example for you.

peek_istance.png

jyothish8807
Master II
Master II

Hi Haika,

You can try like this also:

LOAD

*,

if(year([Open Date] )= year ([Sample Month]), ‘Yes’, ‘No’) as [V1] ;

LOAD

MonthName(‘9/1/2018’) as [Sample Month],

....

[Open Date],

....

From

[folder path]

Br,

KC

Best Regards,
KC
andrei_delta
Partner - Creator III
Partner - Creator III

Hello,

your if expression is not working because you are using it in the Load while the field [Sample Month] is created in the PreLoad.

the order is this: Load -> Preload and just follow KC example.

Hope it helps,

Andrei