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

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

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

please post some sample data for your 2 tables.

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

regards

Marco

balkumarchandel
Valued Contributor II

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

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.

balkumarchandel
Valued Contributor II

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

Have you checked it out ??

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

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

Community Browser