Skip to main content
Announcements
Intermittent issues logging into the Qlik Community. We are working toward a resolution.
cancel
Showing results for 
Search instead for 
Did you mean: 
omid5ive
Creator II
Creator II

sum multi field

hi

i have some data like below:

table 1:

Number
10
20
21
36

table 2:

value
100
98
54
69

i need the multiple of number and value for each record and after that i need sum of all of them
in this case formula should return:

6578

how can i do it

5 Replies
Anil_Babu_Samineni

Can you post expected image on the wall

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sushil353
Master II
Master II

Hi,

What formula have you used to calculate the product sum?

as with simple multiplication and addition it is not coming out 5390

      

100101000
98201960
54211134
69362484
6578
omid5ive
Creator II
Creator II
Author

sorry
yes i need 6578
i will edit it

effinty2112
Master
Master

Hi Omid,

          Try:

Table1:

LOAD

RecNo(),

*;

LOAD * INLINE [

    Number

    10

    20

    21

    36

];

Left Join(Table1)

LOAD

RecNo(),

*;

LOAD * INLINE [

    value

    100

    98

    54

    69

];

Now we can get this straight table:

RecNo() Number value Sum(Number*value)
6578
1101001000
220981960
321541134
436692484

This gives a different answer to the one you were expecting so either I misunderstood what you wanted or you made an arithmetical error.

Hope this helps

Andrew

sunny_talwar

Mapping load also might work, similar to what effinty2112‌ provided:

MappingTable:

Mapping

LOAD RowNo() as Key,

  Number

INLINE [

    Number

    10

    20

    21

    36

];

Table:

LOAD RowNo() as Key,

  value,

  ApplyMap('MappingTable', RowNo()) as Number,

  ApplyMap('MappingTable', RowNo()) * value as FinalNumber

INLINE [

    value

    100

    98

    54

    69

];