Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
Sorry, i made some changes to the script when I posted it, KDate should be CommunicatorDate.
//Hans
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);
Hi Jens, it works, thanks a lot for the help!
Best Regards
//Hans