Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Linking 2 databases with the Shopcode, but need also the Year to be linked

Hey guys, good afternoon!

I have two database, one from the financial department, and one from Salesforce. In both of them I have "Year", "Month" and "Shop code".

The link between those bases is with the "[Shop Code]", but, When I select "Year=2013", from the financial database, it doesn't filter correctly the Salesforce Year. I use a different name for the Salesforce Year, because when I use the same, circular references are made, and then it doesn't work also correctly.

How do I solve this kind of issue?

4 Replies
Not applicable
Author

try concatenating the fields into one

load shopcode & year as shopcodeyear

Not applicable
Author

I mean, I need to solve it in the script part...

v_iyyappan
Specialist
Specialist

Hi,

If you are using same fieldname in Department and SalesForce means concatenate the two table.

for example

Load

     Shopcode,

     Year(Datefield) As year,

From Department;

Concatenate

Load

     Shopcode,

     Year(Datefield) As year,

From SalesForce;

Regards,

jemancilla
Contributor III
Contributor III

You can concatenate the fields Year, Month and Shopcode into a new one: "KeyField"

    Year & '|' & Month '|' & Shopcode AS  KeyField

then, create a link table:

  LinkTable:

    Load

       FieldValue('KeyField',Iterno()) AS KeyField

       ,Subfield(FieldValue('KeyField',Iterno()),'|',1) AS Year

       ,Subfield(FieldValue('KeyField',Iterno()),'|',2) AS Month

       ,Subfield(FieldValue('KeyField',Iterno()),'|',3) AS Shopcode

    AutoGenerate 1

    While(Len(FieldValue('KeyField',Iterno())))

  ;