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

Applymap change

Our team's Qlikview developer has changed the underlying data model and moved the DESK field, from a table called TRADES to another one called TRADESPLITS. Therefore my mapping script below no longer works, as i now get the error;

"Field not found - <DESK>"

My script is as follows

MapProduct:

Mapping LOAD

DESKS & SECTORS as Key,

     PRODUCT

Resident ProductMappings;

TRADES:

LOAD

*,

ApplyMap('MapProduct',DESK,ApplyMap('MapProduct',SECTOR, Null())) as PRODUCT

Resident Trade_Temp;

Drop Tables  Trade_Temp,ProductMappings;

How can I amend this segment of the script to ensure it works? Previously the SECTOR field and DESK field were both in the TRADES table.

The full script is attached for extra clarity if needed.

8 Replies
sujeetsingh
Master III
Master III

Try applying first Applymap and then use the field in next one

sujeetsingh
Master III
Master III

Better if you use two Maping tables

martynlloyd
Partner - Creator III
Partner - Creator III

Sounds like you need to join TRADES with TRADESPLITS

TRADES:

LOAD

*,

...

;

Left Join (TRADES)

LOAD

Key1,

Key2,

ApplyMap('MapProduct',DESK,ApplyMap('MapProduct',SECTOR, Null())) as PRODUCT

Resident TRADESPLITS

;

Not applicable
Author

Would this not duplicate the data in the TRADES table though? Currently one trade can have many splits, so is it wise to change that architecture?

Not applicable
Author

What exactly do you mean? One for the SECTOR field and one for the DESK field?

martynlloyd
Partner - Creator III
Partner - Creator III

Woops!

Yes, you need to Load Distinct after the join.

The result will depend on your data in TRADESPLITS.

Marty.

martynlloyd
Partner - Creator III
Partner - Creator III

Hi Alex,

Given the fundamental change to your data model, I'm wondering maybe you should reconsider your approach, and accepting that DESK is now in the other table, you should map PRODUCT in that table.

I take it that both tables exist in the App? Better to use a little bit of memory and keep it simple...

Regards,

Marty.

Not applicable
Author

Hi Alex, As per my understanding, you changes the table structure (field names). So on QVD Loader stage rename the fields into OLD field names to avoid other changes on the Design Layer.