Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Combining 3 fields from different tables into 1 field in fact table

I'm having trouble figuring out a problem.  Here's the situation... I have two fields (Date and State) in my Fact Table and then another field (Zip Code) that is in another table connected to the Fact Table (Zip Code is not the field from its table that is put into the Fact Table).  Basically, what I want to do is create a field in the fact table that combines all 3 fields.  Example: 20140301Texas75201 (Date&State&Zip Code).

This will help me create a unique identifier for some data that I'm bringing in from a CSV file to connect to my Fact Table.  Any thoughts?  I think a combination of ApplyMap and Concatenate should solve the problem... but I'm not exactly sure how to execute.

4 Replies
MarcoWedel

please post some sample data for your 2 tables.

I'm not quite sure about how the tables are linked.

regards

Marco

Anonymous
Not applicable
Author

hi ,

You can use apply map or just left join and get Zip Code to your fact table then do a resident load and combine the fields.

See attached sample.

Anonymous
Not applicable
Author

Have you checked it out ??

MarcoWedel

Hi,


after joining your Zip code into the fact table you could also generate a key like


LOAD Distinct

    Date,

    State,

    Zip Code,

    AutonumberHash128(Date,State,Zip Code) as key

Resident facttable;


hope this helps


regards


Marco