Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
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
jhoef-pv
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

sunny_talwar

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

vamsee
Specialist
Specialist

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


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

ahaahaaha
Partner - Master
Partner - Master

Hi,

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

fkeuroglian
Partner - Master
Partner - Master

Hi

What error show when you reload?

praveen_prithiviraj
Contributor III
Contributor III

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

Kind Regards,
Praveen Kumar. P
omkarvamsi
Creator
Creator

try DISTINCT in Mapping Load ...

LOAD Distinct

                          Portfolio,

                         Country

   

FROM

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

Marcellino_Groothof
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

alis2063
Creator III
Creator III

HI Yaron,

Kindly use the below,

MapCountrytoPortfolio:

Mapping LOAD distinct Portfolio,

     Country