Skip to main content
Announcements
The way to achieve your own success is the willingness to help somebody else. Go for it!
cancel
Showing results for 
Search instead for 
Did you mean: 
coolwaters
Contributor II
Contributor II

Apply Map Issue

HI,

I am using apply map in an applcation and am getting an error that cannot understand. Am re-creating the problem part below with part of the data.

There are two tables:

1) TRANS

2) AMT

Using applymap I need to get the sales value from the AMT table to the TRANS Table.

The error I get is:

Picture1.png

I am using QlikView 11.20 Sr 17

Below is the code:

TRANS:
LOAD NAME,
      CODE,
      DATE,
      TRANS
    
FROM
[TRANS DATA.xls]
(biff, embedded labels, table is TRANS$);

AMT:
LOAD DATE,
      TRANS,
      TRANS &':'& FLOOR(DATE(DATE#(DATE,'MM/DD/YYYY'),'DD/MM/YYYY')) as KEY_TRANS,
      AMT_PAID
FROM
[TRANS DATA.xls]
(biff, embedded labels, table is AMT$);

AMT_MAP:
MAPPING LOAD
KEY_TRANS,
AMT_PAID
Resident AMT;
DROP TABLE AMT;

DATA:
LOAD
TRANS &':'& FLOOR(DATE(DATE#(DATE,'MM/DD/YYYY'),'DD/MM/YYYY')) AS KEY_TRANS,
*
RESIDENT TRANS;
DROP TABLE TRANS;

FINAL:
LOAD
ApplyMap('AMT_MAP',KEY_TRANS, 0) AS AMT_PAID,
*
RESIDENT DATA;
DROP TABLE DATA; 

1 Solution

Accepted Solutions
sunny_talwar

Not sure I understand the behavior, but this seems to solve the problem

TRANS:

LOAD NAME,

    CODE,

    DATE,

    Text(TRANS) as TRANS

FROM

[TRANS DATA.xls]

(biff, embedded labels, table is TRANS$);

AMT:

LOAD DATE,

    TRANS,

    TRANS &' : '& FLOOR(DATE(DATE#(DATE,'MM/DD/YYYY'),'DD/MM/YYYY')) as KEY_TRANS,

    AMT_PAID

FROM

[TRANS DATA.xls]

(biff, embedded labels, table is AMT$);

AMT_MAP:

MAPPING

LOAD KEY_TRANS,

AMT_PAID

Resident AMT;

DROP TABLE AMT;

DATA:

LOAD TRANS &' : '& FLOOR(DATE(DATE#(DATE,'MM/DD/YYYY'),'DD/MM/YYYY')) AS KEY_TRANS,

*

RESIDENT TRANS;

DROP TABLE TRANS;

FINAL:

LOAD ApplyMap('AMT_MAP',KEY_TRANS, 0) AS AMT_PAID,

*

RESIDENT DATA;

DROP TABLE DATA;

Capture.PNG

View solution in original post

3 Replies
sunny_talwar

Not sure I understand the behavior, but this seems to solve the problem

TRANS:

LOAD NAME,

    CODE,

    DATE,

    Text(TRANS) as TRANS

FROM

[TRANS DATA.xls]

(biff, embedded labels, table is TRANS$);

AMT:

LOAD DATE,

    TRANS,

    TRANS &' : '& FLOOR(DATE(DATE#(DATE,'MM/DD/YYYY'),'DD/MM/YYYY')) as KEY_TRANS,

    AMT_PAID

FROM

[TRANS DATA.xls]

(biff, embedded labels, table is AMT$);

AMT_MAP:

MAPPING

LOAD KEY_TRANS,

AMT_PAID

Resident AMT;

DROP TABLE AMT;

DATA:

LOAD TRANS &' : '& FLOOR(DATE(DATE#(DATE,'MM/DD/YYYY'),'DD/MM/YYYY')) AS KEY_TRANS,

*

RESIDENT TRANS;

DROP TABLE TRANS;

FINAL:

LOAD ApplyMap('AMT_MAP',KEY_TRANS, 0) AS AMT_PAID,

*

RESIDENT DATA;

DROP TABLE DATA;

Capture.PNG

coolwaters
Contributor II
Contributor II
Author

Hi Sunny,

Thanks as always for helping out, it works.

Appreciate it.

ysj
Creator
Creator