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

Represent Values Returned Differently

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'

5 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

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

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

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

Not applicable
Author

Hi blue,

     Change the tab order to resolve, the map has to be declared before to use.

Not applicable
Author

Thank you made all the difference, return the expected result.

Not applicable
Author

Please mark the correct answer to close the cuestion