Qlik Community

Ask a Question

New to QlikView

If you’re new to QlikView, start with this Discussion Board and get up-to-speed quickly.

Announcements
Talk to Experts Tuesday, January 26th at 10AM EST: Qlik Sense. REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Problem with Applymap

I have a problem using Applymap to populate Jan2017 table with a field Country. Is there anything wrong with my script?

MapCountrytoPortfolio:

Mapping LOAD Portfolio,

     Country

    

FROM

(biff, embedded labels, header is 1 lines, table is PortfolioStructure$);

Jan2017:

LOAD DAY,

     TRADENBR,

     ENTITYID AS Entity,

     NODEID AS Portfolio,

     PRODUCT_TYPE AS Product,

     PRODUCT_ID AS Instrument,

     STRATEGY,

     COUNTERPART,

     CCY,

     TRADE_OCY AS [Sales Margin OCY],

     SPOT_FX,

     SPOT_RATE,

     TRADE_LCY AS [Sales Margin LCY],

     TYPE,

     Month(DAY) AS Month,

     Dual('Q' & Ceil(Month(DAY)/3), Ceil(Month(DAY)/3)) AS Quarter,

     Year(DAY) AS Year,

     Applymap('MapCountrytoPortfolio', Portfolio,'NA') as Country

    

    

    

FROM

(ooxml, embedded labels, table is [Sales Margin Report by Budget R]);

9 Replies
Contributor III
Contributor III

Hi,

Jan2017:

LOAD DAY,

     TRADENBR,

     ENTITYID AS Entity,

     NODEID AS Portfolio,

     PRODUCT_TYPE AS Product,

     PRODUCT_ID AS Instrument,

     STRATEGY,

     COUNTERPART,

     CCY,

     TRADE_OCY AS [Sales Margin OCY],

     SPOT_FX,

     SPOT_RATE,

     TRADE_LCY AS [Sales Margin LCY],

     TYPE,

     Month(DAY) AS Month,

     Dual('Q' & Ceil(Month(DAY)/3), Ceil(Month(DAY)/3)) AS Quarter,

     Year(DAY) AS Year,

     Applymap('MapCountrytoPortfolio', NODEID ,'NA') as Country

          

FROM

(ooxml, embedded labels, table is [Sales Margin Report by Budget R]);

Regards

Doesn't look like it... are you getting an error?

Specialist
Specialist

Applymap('MapCountrytoPortfolio', Portfolio,'NA') as Country


Applymap('MapCountrytoPortfolio',      NODEID,     'NA') as Country

Master
Master

Hi,

I think that if earlier the script worked correctly, need to analyze the downloadable data

Partner
Partner

Hi

What error show when you reload?

Contributor III
Contributor III

Applymap('MapCountrytoPortfolio',NODEID,'NA') as Country

Kind Regards,
Praveen Kumar. P
Creator
Creator

try DISTINCT in Mapping Load ...

LOAD Distinct

                          Portfolio,

                         Country

   

FROM

(biff, embedded labels, header is 1 lines, table is PortfolioStructure$);

Contributor III
Contributor III

Hi,

Try this: change Mapping LOAD Portfolio   in  

                           Mapping LOAD NODEID

and change

Applymap('MapCountrytoPortfolio', Portfolio,'NA') as Country  in

Applymap('MapCountrytoPortfolio', NODEID,'NA') as Country

Greetings,

Marcellino

Creator II
Creator II

HI Yaron,

Kindly use the below,

MapCountrytoPortfolio:

Mapping LOAD distinct Portfolio,

     Country