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

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

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

try concatenating the fields into one

load shopcode & year as shopcodeyear

Not applicable

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

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

v_iyyappan
Valued Contributor

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

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
New Contributor III

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

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())))

  ;

Community Browser