Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

adrianbuzer
Contributor II

applymap number v text

Hi

In my script I have the following

load [Supplier Number],
applymap ('MissingSupplierMap',[Supplier Number],'No Data') as [Supplier]
resident 'Table';

I think that the [Supplier Number] field in 'Table' is text and the [Supplier Number] in the mapping table is a number.  I'm sure this worked previously but now it is returning 'No Data' for all the supplier numbers.  Is it because one is text and the other is a number?

Thanks

A

4 Replies
crusader_
Valued Contributor

Re: applymap number v text

Hi,

Actually QlikView trying to convert to number from text in every possible opportunity, and I reproduced behavior which you described only by explicit conversion to Text() inside ApplyMap() function... You can resolve this issue using explicit conversion to numeric via num() function.

load [Supplier Number],
applymap ('MissingSupplierMap',Num([Supplier Number]),'No Data') as [Supplier]
resident 'Table';

Hope this helps.

Regards,

Andrei

sergey_maka8
Valued Contributor

Re: applymap number v text

Hi Adrian,

Try to find a definition of MissingSupplierMap.

It should be like

MissingSupplierMap:

MAPPING LOAD...

If you don't have this definition you will have 'No data' as result of applymap ('MissingSupplierMap',[Supplier Number],'No Data') as [Supplier]

The second thing is if you have the definition of MissingSupplierMap map, try to load it as a normal table (without MAPPING) and compare the first field with [Supplier Number].

You will see if something wrong.

Regards,

Sergey

balkumarchandel
Valued Contributor II

Re: applymap number v text

have you checked you have matching Supplier Number in both tables.

if yes , try to load you data with num(trim([Supplier Number]))  in script the  use apply map

Re: applymap number v text

Post your data.app if your still in doubt

Community Browser