Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
dunnalahk123
Creator III
Creator III

Mapping Load

Hi,

Can some one help me here for mapping load and apply map

i am writing script as below,


MAP:

mapping LOAD

[PSA Project pse Project ID],
[HOLD Closure date2]  
 
FROM
[$(QVD_Path)\GSD_HOLDClosuredate2.qvd]
(qvd);


HOLD:

LOAD

     [PSA Project pse Project ID],
     [HOLD Closure date],
    Applymap('MAP', [PSA Project pse Project ID],[HOLD Closure date2]) as T

FROM
[$(QVD_Path)\GSD_HOLDClosuredate.qvd]
(qvd);

out put i got as below,

but here one Project ID  can have multiple dates, but when i wrote apply map for "T" column  2 rows dates are coming same which it should not be. it should come one date as 08/16/2017 and second date as 09/29/2017. as shown in second snapshot.

can some one help me here.

Joinnew.PNG

Test.PNG

1 Solution

Accepted Solutions
sunny_talwar

I think I might know what went wrong... can you try this

MAP:

MAPPING

LOAD [PSA Project pse Project ID] & AutoNumber(RowNo(), [PSA Project pse Project ID] & 1),

    [HOLD Closure date2]
FROM [$(QVD_Path)\GSD_HOLDClosuredate2.qvd] (qvd);


HOLD:

LOAD [PSA Project pse Project ID],
    [HOLD Closure date],
    Applymap('MAP', [PSA Project pse Project ID] & AutoNumber(RowNo(), [PSA Project pse Project ID] & 2)) as T

FROM [$(QVD_Path)\GSD_HOLDClosuredate.qvd] (qvd);

View solution in original post

22 Replies
prma7799
Master III
Master III

try this

Applymap('MAP', [PSA Project pse Project ID], Null() ) as T


or please share some sample app


* you have two records ([HOLD Closure date]) for [PSA Project pse Project ID] (PR- 539478)


dunnalahk123
Creator III
Creator III
Author

HI,

I already Tried that same results i am getting

!Joinnew.PNG

in T Column we are getting same Date's  but i should see 2 different Dates.

peterwh
Creator II
Creator II

Hello,

mapping doesn't work with multiple values under one key ([PSA Project pse Project ID]). So this is the normal behaviour.

"The only time that you cannot use Applymap() instead of a join is if you want to fetch more than one single corresponding value (record) from the second table." (Source: https://community.qlik.com/blogs/qlikviewdesignblog/2012/09/18/one-favorite-function-applymap)

Kind regards

Peter

mhappiee
Partner - Contributor III
Partner - Contributor III

Any specific reason to use Mapping load ?,

if not you can simply do that using  joins like left or Inner

Anand

sunny_talwar

How about this

MAP:

MAPPING

LOAD [PSA Project pse Project ID] & AutoNumber(RowNo(), [PSA Project pse Project ID]),

    [HOLD Closure date2]
FROM [$(QVD_Path)\GSD_HOLDClosuredate2.qvd] (qvd);


HOLD:

LOAD [PSA Project pse Project ID],
    [HOLD Closure date],
    Applymap('MAP', [PSA Project pse Project ID] & AutoNumber(RowNo(), [PSA Project pse Project ID])) as T

FROM [$(QVD_Path)\GSD_HOLDClosuredate.qvd] (qvd);

dunnalahk123
Creator III
Creator III
Author

Hi Anand,

i tried using join it is not working as it will duplicates the rows.

As we have 2 timestamps for same Project ID.

JOin.PNG

balabhaskarqlik

May be like this:

MAP:

Mapping LOAD

[PSA Project pse Project ID],

[HOLD Closure date2] 

FROM

[$(QVD_Path)\GSD_HOLDClosuredate2.qvd](qvd);

HOLD:

LOAD

     [PSA Project pse Project ID],

     [HOLD Closure date],

     Applymap('MAP', [PSA Project pse Project ID], ApplyMap('MAP',[HOLD Closure date2],Null()) as T

FROM

[$(QVD_Path)\GSD_HOLDClosuredate.qvd](qvd);

dunnalahk123
Creator III
Creator III
Author

Hi Sunny,

Thank You for looking into this.

i tried your script below is what i got , i am getting project iD's instead of time stamps.

Sunny.PNG

but i need below 2 time stamps

Test.PNG

sunny_talwar

How many instances of  PR-539478 do you have in your GSD_HOLDClosuredate.qvd? It seems that it might be more than 4? how many instances do you have in GSD_HOLDClosuredate2.qvd?

If one qvd has more than the other, how do you expect to map them?