Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
maternmi
Contributor II

Apply map - where is the bug

Hi everybody,

I've tried the first time to use apply map instead of join statement but it is not working as I thought.  The reload works but I don't see in the VBEP table the REQ_Delivery_Date. Do you know where the mistake is?

Here the code

MappingEDDtoVBEP:

 

Mapping Load %VKANRHD%POSHD as %VBELN%UEPOS,

                        ZGS_SCM_MONITOR.EARLIEST_DELIV       

From

  ...Pickup_Reliability\QVDs\ZGS_SCM_MONITOR_01.qvd (qvd)

;     

VBEP:

Load *,

ApplyMap('MappingEDDtoVBEP',%VBELN%UEPOS) as REQ_Delivery_Date

;

Thank you in advance

BR

Michael

 

1 Solution

Accepted Solutions
salto
Valued Contributor II

Re: Apply map - where is the bug

Hi,


MappingEDDtoVBEP:

Mapping Load %VKANRHD%POSHD as %VBELN%UEPOS,

                        ZGS_SCM_MONITOR.EARLIEST_DELIV      

From

  ...Pickup_Reliability\QVDs\ZGS_SCM_MONITOR_01.qvd (qvd)

;    

VBEP:

Load *,

ApplyMap('MappingEDDtoVBEP',%VBELN%UEPOS, 'No match') as REQ_Delivery_Date

From [YOUR VBEP TABLE]

;


Hth.

23 Replies
rustyfishbones
Honored Contributor II

Re: Apply map - where is the bug

try removing the Alias on the Mapping Table

Mapping Load %VKANRHD%POSHD ,

                        ZGS_SCM_MONITOR.EARLIEST_DELIV      

From

  ...Pickup_Reliability\QVDs\ZGS_SCM_MONITOR_01.qvd (qvd)

;    

VBEP:

Load *,

ApplyMap('MappingEDDtoVBEP',%VKANRHD%POSHD) as REQ_Delivery_Date

;

anbu1984
Honored Contributor III

Re: Apply map - where is the bug

From which table are you loading VBEP?

VBEP:

Load *,

ApplyMap('MappingEDDtoVBEP',%VBELN%UEPOS) as REQ_Delivery_Date

;

salto
Valued Contributor II

Re: Apply map - where is the bug

Hello Michael,

ApplyMap('MappingEDDtoVBEP',%VBELN%UEPOS,'Not Found') as REQ_Delivery_Date


Is there a correspondence between the values of the second table and the values of the mapping table? If not, maybe that is the reason to have no values in REQ_Delivery_Date.


Hth.-

Not applicable

Re: Apply map - where is the bug

Hi,

VBEP:

Load *,

ApplyMap('MappingEDDtoVBEP',%VBELN%UEPOS) as REQ_Delivery_Date

;

What is the source for this table,atleast you need to use resident or else uyou can load it from some other table.

maternmi
Contributor II

Re: Apply map - where is the bug

Hi,

Thank you for your feedback. I modified the apply map statement as suggested but without success. Without alias, with from and resident in the mapping table. I also add 'Not found'...

My table VBEP will be loaded at the beginning with the data base model, so it already exists.

Have you further ideas?

maternmi
Contributor II

Re: Apply map - where is the bug

Hello Salto,

what do you mean with correspondanc between the values. The ID is equal but there is no equal date field.

BR

Michael

oknotsen
Honored Contributor III

Re: Apply map - where is the bug

What error are you getting (if any)?

Does %VBELN%UEPOS exist in the source you use for VBEP?

What is the content of that field in VBEP? Is there actually any content?

Does it match the casing in the mapping table?

May you live in interesting times!
maternmi
Contributor II

Re: Apply map - where is the bug

yes, %VBELN%UEPOS is the id of the table VBEP

if you mean the content of Req_Delivery_Date, then the column doesn't exists.

Actually with apply map I wanted to avoid (left joins statements). Is it possible or did I misunderstand the function of apply map

mrybalko
Contributor

Re: Apply map - where is the bug

Could you please provide test qvw?

You can check mapping table consistency by joining it to fact table. The problem may be in columns data types. For example in mapping table dates are strings and in fact tables - numbers.

Community Browser