Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
zagzebski
Contributor

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

Tags (2)
1 Solution

Accepted Solutions
amartinez35
Valued Contributor

Re: Creating a variable from a Load

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

3 Replies
amartinez35
Valued Contributor

Re: Creating a variable from a Load

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

zagzebski
Contributor

Re: Creating a variable from a Load

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


amartinez35
Valued Contributor

Re: Creating a variable from a Load

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

Community Browser