Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

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
MVP
MVP

Re: Represent Values Returned Differently

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

Not applicable

Re: Represent Values Returned Differently

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

Highlighted
Not applicable

Re: Represent Values Returned Differently

Hi blue,

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

Not applicable

Re: Represent Values Returned Differently

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

Not applicable

Re: Represent Values Returned Differently

Please mark the correct answer to close the cuestion

Community Browser