Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Data returned through a query is a code, I want to change the value returned into someting meaningful for the users e,g, value retuned = CUSTOMORDCRE this I would like to present as Invoiced Value, there are four values I want to represent differently, how to I achive this. I have tried using if but this ony appears to work for one value.
CUSTCOLDEB = 'Invoiced Value'
CUSTCOMMCRE = 'Commision Credit'
CUSTORDCRE = 'Customer Order Credit No RMA'
CUSTORDDEB = 'Customer Credit RMA'
Hi
I would use a mapping table like this (assuming the code values are in field Code, and the result should be in field Name - change as required for your data):
MapNames:
Mapping LOAD * Inline
[
Code, Name
CUSTCOLDEB, Invoiced Value
CUSTCOMMCRE, Commision Credit
CUSTORDCRE, Customer Order Credit No RMA
CUSTORDDEB, Customer Credit RMA
];
Data:
LOAD ...
...
Code,
ApplyMap('MapNames', Code) As Name,
...
FROM ...
In a working app, you might build the mapping table from a database or spreadsheet source, rather than hardcoded as an inline source.
Hope that helps
Jonathan
Hello Jonathan
Thanks for the advise, unfortunately my report does not return any values, in tab1 I have enterd
LOAD...
CURRENCY_CODE,
CONTRACT,
ORDER_NO,
INVOICE_TYPE,
applymap('CustInvTypeMap',INVOICE_TYPE) as InvTypeDescr
FROM
G:\bk\Customer.xlsx(ooxml, embedded labels, table is CustOrdInv);
in tab 2
//Invoice Type Description
CustInvTypeMap:
Mapping LOAD * Inline
[
INVOICE_TYPE, Inv_Type_Descr
CUSTCOMMCRE, Commission Credit
CUSTORDCRE, Customer Order - No RMA
CUSTORDDEB, Customer Order - RMA
CUSTCOLCRE, Invoice Value
];
I am sure it simple error on my part, any futher suggestions would be most welcome.
Regards
Bruce
Hi blue,
Change the tab order to resolve, the map has to be declared before to use.
Thank you made all the difference, return the expected result.
Please mark the correct answer to close the cuestion