Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
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
Specialist II
Specialist II

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!

View solution in original post

4 Replies
jerem1234
Specialist II
Specialist II

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!

ashfaq_haseeb
Champion III
Champion III

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
Author

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

Not applicable
Author

your friend - KILGORE WATTS