Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
raadwiptec
Creator II
Creator II

applymap

Test:

Mapping Load

Invoice ID

rate

from yyy.....

source1

Invoice ID

Country

.applMap('Test',Invoice ID) as rates

..

from xxx....

my look up data is something like below

Invoice ID | Country |Billed Date | rate

1000  |UK |2-Aug| 10

1000  |UK |3-Aug| 13

1000  |UK |2-Sep| 12


My Issue is applymap is taking only the First value i.e 10 in this case.. the output should be 35 actually

1 Solution

Accepted Solutions
sunny_talwar

Try this for your mapping load:

Test:

Mapping

LOAD [Invoice ID]

          Sum(rate) as SummedRate

from yyy.....

Group By [Invoice ID];

View solution in original post

5 Replies
sunny_talwar

Try this for your mapping load:

Test:

Mapping

LOAD [Invoice ID]

          Sum(rate) as SummedRate

from yyy.....

Group By [Invoice ID];

p_verkooijen
Partner - Specialist
Partner - Specialist

Applymap only matches first find.

If you need the sum of rates use

Test:

Mapping Load

  Invoice ID,

  SUM(rate) AS Rate

From yyy.....

  GROUP BY  Invoice ID;



el_aprendiz111
Specialist
Specialist

Hi,

Look

Test.png

maxgro
MVP
MVP

you can left join the source1 table by invoice id

with the sum of rate group by invoice id of the lookup data

shraddha_g
Partner - Master III
Partner - Master III

Apply map won't sum up the values. Instead you will have to aggregate those values using aggregation function sum()

Load

"Invoice ID",

sum(rate) as rate

from yyy

group by "Invoice ID";


right join

source1:

Load

"Invoice ID",

Country,

"Billed Date"

from xxx....

it will give you result as

Invoice ID | Country |Billed Date | rate

1000  |UK |2-Aug| 35

1000  |UK |3-Aug| 35

1000  |UK |2-Sep| 35


I hope it is helpful.