Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello, I hope you can help me with new info.
I have the following table:
Description Value Reserve
Canada 10
Sweden 15
Chine 7
Japan - Poland
Poland 8
Finland 3 Norwey
Norwey 5
I need to remake this table in order to add extra value from reserved countries:
Description Value
Canada 10
Sweden 15
Chine 7
Japan 8
Poland 8
Finland 8
Norwey 5
How can I do this transformation?
Thank you in advance!
Hi Ruslans,
Create a mapping table:
[map_table]:
LOAD distinct Reserve,
Value
FROM YourTable...;
[YourTable]:
LOAD
Description
Applymap('map_table',Description, Value) as Value
FROM YourTable...;
Can you please hel with a correct syntax?
Doesn't work right now.
'MAP_TABLE':
LOAD distinct
Alternative_Contract_Number,
Contract_Delivery_Times
RESIDENT CONTRACT_AND_DELIVERIES;
FINAL_DATA:
LOAD
Contract_Number,
Contract_Name,
Customer_Number,
Manager_Name,
Customer_Type,
Contract_Start_Date,
Contract_Devices_Quantity,
Alternative_Contract_Number,
Contract_Delivery_Times,
Applymap('MAP_TABLE',Contract_Number, Contract_Delivery_Times) AS Contract_Delivery_Times_Alternative
RESIDENT CONTRACT_AND_DELIVERIES;
DROP TABLE CONTRACT_AND_DELIVERIES;
DROP TABLE 'MAP_TABLE';
try with below script:
MAP_TABLE:
Mapping
LOAD distinct
Alternative_Contract_Number,
Contract_Delivery_Times
RESIDENT CONTRACT_AND_DELIVERIES;
FINAL_DATA:
LOAD
Contract_Number,
Contract_Name,
Customer_Number,
Manager_Name,
Customer_Type,
Contract_Start_Date,
Contract_Devices_Quantity,
Alternative_Contract_Number,
Contract_Delivery_Times,
ApplyMap('MAP_TABLE', Contract_Number, 'N/A') AS Contract_Delivery_Times_Alternative
RESIDENT CONTRACT_AND_DELIVERIES;
DROP TABLE CONTRACT_AND_DELIVERIES;
Now, changes are made for ALL rows, not only for Contracts will atlernative values
Hi Ruslans
You can get more information about "mapping" here https://help.qlik.com/es-ES/qlikview/12.1/Subsystems/Client/Content/Scripting/ScriptPrefixes/Mapping...
Try this:
'MAP_TABLE':
Mapping LOAD distinct
Contract_Number,
Contract_Delivery_Times
RESIDENT CONTRACT_AND_DELIVERIES;
FINAL_DATA:
LOAD
Contract_Number,
Contract_Name,
Customer_Number,
Manager_Name,
Customer_Type,
Contract_Start_Date,
Contract_Devices_Quantity,
Alternative_Contract_Number,
Contract_Delivery_Times,
Applymap('MAP_TABLE',Alternative_Contract_Number, Contract_Delivery_Times) AS Contract_Delivery_Times_Alternative
RESIDENT CONTRACT_AND_DELIVERIES;
DROP TABLE CONTRACT_AND_DELIVERIES;