I am trying to load some meta data, break that data into parent and child tables and then map one of the attributes in the child table to the parent table.
For instance the meta data has a field labeled 'CODE' with values that looks like AAA:B, AAA:C, AAA:D. I wanted to break this apart so that I would have AAA in the parent table and then B in the child table. To do that I did this:
[Metadata]: LOAD [REGS], [LITERAL], [DESCRIPTION], [CODE] FROM [lib://metadata.csv] (txt, codepage is 28591, embedded labels, delimiter is '|', no quotes); STORE [Metadata] INTO [lib://Metadata.qvd](qvd);
//BREAK INTO PARENT CHILD TABLES AND RENAME COLUMNS
[PARENT]: Load [REGS] AS [AUTHORITATIVE SOURCE], [LITERAL] AS [TITLE], [DESCRIPTION], [CODE] AS [ENTITY]
Resident [Metadata] where findoneof([CODE],':')=0;
[CHILD]: Load [LITERAL] AS [SUB TITLE], [DESCRIPTION] AS [SUB DESCRIPTION], [CODE] Resident [Metadata] where findoneof([CODE],':') >0; DROP TABLE [Pub Log Metadata];
Then I wanted to Map the B,C,D back to AAA. Do to that I am trying to do something like below but it's not working.
MapAAA: Mapping LOAD
CODE,[SUB TITLE] RESIDENT [CHILD];
WHERE [ENTITY] = 'AAA';
ApplyMap('MapAAA', AAA,'Not Specified')) AS "AAA Title",
When I try to load the data, I get an error of "'ENTITY', 'CODE' not found"