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: 
vittorianad
Contributor III
Contributor III

How to load field value as sum() of different field's table

Hi,

let's say I have 

Order:
load
     id_order,
    date_order,
    id_client
from [qvd\order.qvd] (qvd);

lineOrder:
load
    id_order,
    id_line_order,
    ammount_line
from [qvd\orderline.qvd] (qvd);

I need the total ammount calculated on the Order table. 

How can I get this?

I want the Order table to be

Order:
load
    id_order,
    Date_order,
    id_client,
    total_ammount_order
from [qvd\order.qvd] (qvd);

Thanks to all

2 Replies
martinpohl
Partner - Master
Partner - Master

Hi,

Orders:
load
     id_order,
    date_order,
    id_client
from [qvd\order.qvd] (qvd);

left join (Orders)
load
    id_order,
    id_line_order,
    ammount_line
from [qvd\order.qvd] (qvd);

 

left join (Orders)

load

id_order,

sum(ammount_line) as sumorder

resident Orders

group by id_order;

 

Regards

vittorianad
Contributor III
Contributor III
Author

hi,

I want to keep separated the Order and the Orderline table,

the code you suggest does the left join...

Instead ....

left join (Orders)

load

id_order,

sum(ammount_line) as sumorder

resident Orders

group by id_order;

return me and error as invalid statement!!