Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

applymap - "could not find field" error message?

Hi, I am having some problems with the applymap-function, and I don´t understand why.

The problem accurse when I use applymap together with the field CommunicatorDate

text(Communicator) & '|' & date(Date) as CommunicatorDate,

When I run the script I get the message "could not find field - <CommunicatorDate>"

If I use for example Date instead of Communicatordate the applymap-function works.

See below:

ArbetspassInfo:

LOAD text(Communicator) as Kommunikator2,

text(Kommunikator) & '|' & date(Date) as KDate,

date(Date) as Date,

Tid,

Timlon,

Tid * Timlon as Kostnad

FROM

[TestDatabas.xlsx]

(ooxml, embedded labels, table is Arbetspass);

MapKost:

Mapping Load KDate, Kostnad Resident ArbetspassInfo;

Resultat:

LOAD text(Kommunikator) &'|' & date(Date) as KDate,

text(PlayerID) as PlayerID,

Kommunikator,

date(Date) as Date,

ApplyMap('MapKost',CommunicatorDate) as kostnad

FROM

[TestDatabas.xlsx]

(ooxml, embedded labels, table is Samtal);

Can anyone help me figure out why and how to do solve it?

Thanks!

//Hans

3 Replies
Not applicable
Author

Sorry, i made some changes to the script when I posted it, KDate should be CommunicatorDate.

//Hans

Not applicable
Author

Hi Hans,

I think the problem is, that the field CommunicatorData isn't found in the Resultat table. Not because of the KDate/CommunicatorData name twist, but because the creation of CommunicatorData happens it the same step as Applymap uses the field.

To solve this, you could make a preceeding load
Load ApplyMap('MapKost',CommunicatorDate) as kostnad, *;
LOAD text(Kommunikator) &'|' & date(Date) as KDate, //(CommunicatorDate)
text(PlayerID) as PlayerID,
Kommunikator,
date(Date) as Date

FROM

[TestDatabas.xlsx]

(ooxml, embedded labels, table is Samtal);



Not applicable
Author

Hi Jens, it works, thanks a lot for the help!

Best Regards

//Hans