Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
zagzebski
Creator
Creator

Creating a variable from a Load

I need take the Max Date of a table (Master Cube table below) and use that date in my where clause for another table.

I know my script is NOT right below. But how do I get the vGLDATE field from the Master Cube into the Where clause of my Current Budget table

Master Cube:

Load

max(GLDATE) as vGLDATE

Resident Production;

Current Budget:

Load *

Resident Budget

Where vGLDATE < BUDGET_DATE;


Thanks,

Steve

1 Solution

Accepted Solutions
Aurelien_Martinez
Partner - Specialist II
Partner - Specialist II

Hi,

Try:

Master Cube:

Load

max(GLDATE) as vGLDATE

Resident Production;

LET vGLDATE = Peek('vGLDATE', 0, 'Master Cube')

Current Budget:

Load *

Resident Budget

Where $(vGLDATE) < BUDGET_DATE;

Best,

Aurélien

Help users find answers! Don't forget to mark a solution that worked for you!

View solution in original post

3 Replies
Aurelien_Martinez
Partner - Specialist II
Partner - Specialist II

Hi,

Try:

Master Cube:

Load

max(GLDATE) as vGLDATE

Resident Production;

LET vGLDATE = Peek('vGLDATE', 0, 'Master Cube')

Current Budget:

Load *

Resident Budget

Where $(vGLDATE) < BUDGET_DATE;

Best,

Aurélien

Help users find answers! Don't forget to mark a solution that worked for you!
zagzebski
Creator
Creator
Author

Thanks so much.

Just some clairification

LET vGLDATE = Peek('vGLDATE,0,"Master Cube")

What is the peek function doing? Is it saying look at the last vGLDATE and if you find nothing make it a 0 or therwise give me the date?

Thanks, Steve


Aurelien_Martinez
Partner - Specialist II
Partner - Specialist II

When you use Peek function like : Peek('vGLDATE,0,"Master Cube")

Peek returns the value of vGLDATE from the first record read into the input table labeled Master Cube.

Read "Inter Record Functions" in QlikView Help

Help users find answers! Don't forget to mark a solution that worked for you!