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.
Not applicable

Table creation in script question

I have created a table in my data model called AllData. I would like to create a new table (called PreviousData) in the same data model that loads all the fields from AllData, but only for a specific date (which is a field in AllData). I can't seem to get the syntax right. Can somebody help me with this?

I'd assume it looks something like what I have below but I'm not sure where to put the where clause.

PreviousData:

Load *,

Resident AllData;

where PROD_DT = '07/31/2014';

1 Solution

Accepted Solutions
jerem1234
Valued Contributor II

Re: Table creation in script question

It goes after the resident load like you have it:

PreviousData:

NoConcatenate Load *

Resident AllData

where PROD_DT = '07/31/2014';

This will create synthetic keys since the fields you are loading in are the same as the AllData table (notice the noconcatenate keyword to prevent the tables from joining). You'll after to worry about how it will link (or won't link) to your data. Maybe as simple as just changing the field names in PreviousData to something different or using qualify.

Hope this helps!

4 Replies
jerem1234
Valued Contributor II

Re: Table creation in script question

It goes after the resident load like you have it:

PreviousData:

NoConcatenate Load *

Resident AllData

where PROD_DT = '07/31/2014';

This will create synthetic keys since the fields you are loading in are the same as the AllData table (notice the noconcatenate keyword to prevent the tables from joining). You'll after to worry about how it will link (or won't link) to your data. Maybe as simple as just changing the field names in PreviousData to something different or using qualify.

Hope this helps!

Re: Table creation in script question

Hi Try Below

Noconcatenate

Qualify *;

PreviousData:

Load *

Resident AllData

where PROD_DT = '07/31/2014';

UnQualify *;

It will not create syenthetic key.

Regards

ASHFAQ

Not applicable

Re: Table creation in script question

sounds like good answer kurpat! i think you desrve the points on this

Not applicable

Re: Table creation in script question

your friend - KILGORE WATTS

Community Browser