Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Assigning existing values to new fields in load script

Hi,

I have a collection of "parent" issuers which have been mapped to data that is stored in a separate QVD (the data is keyed on the ISSUERID field). I also have a collection of "child" issuers which are related to the "parent" issuers by sharing an AGENTID value between the two of them - i.e., one pair of "parent" and "child" issuers will share the same AGENTID. The ISSUERID field for the "child" issuers are not stored in the QVD from which I am retrieving the data for the "parent" issuer - so a Left Join on the separate QVD returns the assigned data for the "parent" ISSUERID and nothing for the "child" ISSUERID:

AGENTID

ISSUERID

MGMNTLNID

MGMNTLNDESC

BUSGRPID_1

BUSGRPDESC_1

BUSGRPID_2

BUSGRPDESC_2

555

1234567

1

Business

101

Retail

1010

Fashion Retail

555

1234568

-

-

-

-

-

-

I need to find a way to give the "child" issuer the values that have been assigned to the corresponding "parent" issuer (i.e., the "parent" issuer with the same AGENTID value as the "child" issuer). So, an Oracle equivalent might be:

INSERT INTO [table] (SELECT MGMNTLNID,MGMNTLNDESC,BUSGRPID_1,BUSGRPDESC_1,BUSGRPID_2,BUSGRPDESC_2) FROM [source] WHERE [AGENTID values match]

So, I need to copy the assigned values, not move them away from the "parent" issuer. How can this be achieved within the load script?

Also, I need to be able to display the assigned values for both the "parent" and "child" issuers in the UI.

Many thanks,

VB

3 Replies
Not applicable
Author

Hi,

I didn't clearly understand the issue here but maybe you could create a new key AGENTID&':'&ISSUERID to achieve something...

Would that help?

Anonymous
Not applicable
Author

Hi Bastien,

As the ISSUERID value is different between the "parent" issuer and the "child" issuer, a AGENTID&':'&ISSUERID key would always be unique - so, how would such a key help in assigning to the child issuer the same values that have already been assigned to the parent issuer?

Using the above dataset as an example, the desired result is this:

AGENTID

ISSUERID

MGMNTLNID

MGMNTLNDESC

BUSGRPID_1

BUSGRPDESC_1

BUSGRPID_2

BUSGRPDESC_2

555

1234567

1

Business

101

Retail

1010

Fashion Retail

555

1234568

1

Business

101

Retail

1010

Fashion Retail

Not applicable
Author

Hi,

In this case here's what you could do (assuming that AGENTID exists in the child issuers QVD):

  • LOAD your parents issuer QVD without the ISSUERID Field (Table1)
  • LEFT JOIN LOAD your child issuers QVD to Table1
    > Now you should have your child records populated
  • CONCATENATE LOAD the parents issuers QVD to Table1

Would that work for you?