Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I am driving nuts...
Any clue why I do not get any result from the ApplyMap? the result is not found and it does not even display 'missing'...
Applymap('Map_DiscountedSeason',Floor(MonthStart(DateId),1),'missing') as DiscountedCollection
(with DateId='01/01/2018')
Also, I would like to stress that Floor(MonthStart('01/01/2018'),1)=43101 which is also the value I see when I check the Map using the view panel.
Thank you in advance,
MT
File :
TimeFrame;DiscountedSeason
2018-1;0
2018-1;0
Map_DiscountedSeason:
LOAD Num(Date#(TimeFrame, 'YYYY-MM')) As Month,
[DiscountedSeason]
FROM [$(folderData)/SeasonToBeDiscounted.csv]
(txt, codepage is 1252, embedded labels, delimiter is ';', msq);
Hi,
In the applymap table before load statement you have to use Mapping Syntax.
And thus table should be load before to the main Table.
Map_DiscountedSeason:
Mapping
LOAD Num(Date#(TimeFrame, 'YYYY-MM')) As Month,
[DiscountedSeason]
FROM [$(folderData)/SeasonToBeDiscounted.csv]
(txt, codepage is 1252, embedded labels, delimiter is ';', msq);
My guess is that Map_DiscountedSeason is not a valid mapping table and therefore you are getting nulls. A couple of notes regarding mapping tables.
1. The mapping table must be loaded in the script before it is referenced in an ApplyMap().
2. You must use the MAPPING prefix on the load as Mohammed Mukram indicated. If you can see the map in the table viewer you forgot the MAPPING prefix.
3. In QV11, a missing mapping table causes null to be returned from ApplyMap(). In QV12.10, a missing map throws a script error.
-Rob
Thank you Mohammed and Rob !
It is working fine now and I have learnt usefull tips!
Best regards,
MT