Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Datafile:
I like to calculate some variables when loading my data but I'm not sure how to deal with the the syntax.
(I've LOTS OF variables to calculate and like to do it when loading data instead of calculate on the fly using expressions)
1) I like to create a variable called 'G1' which should sum Product AB01 combined with Salespoint 1200 (In this case result = 3)
2) I like to create a variable called 'G2' which should sum Product QP01 combined with Salespoint 1200 + Product QP01 combined with Salespoint 1400 (In this case result = 5)
Table1:
LOAD Product, SalesPoint, Quantity FROM ...
Table2:
LOAD
'G1' as MyField,
sum(Quantity) as result
RESIDENT
Table1
WHERE
Product = 'AB01' and SalesPoint = 1200
;
CONCATENATE (Table2)
LOAD
'G2' as MyField,
sum(Quantity) as result
RESIDENT
Table1
WHERE
Product = 'QP01' and (SalesPoint = 1200 or SalesPoint = 1400)
;
See if this is helpful
Storing variables outside of QlikView - The Qlik Fix! The Qlik Fix!
Table1:
LOAD Product, SalesPoint, Quantity FROM ...
Table2:
LOAD
'G1' as MyField,
sum(Quantity) as result
RESIDENT
Table1
WHERE
Product = 'AB01' and SalesPoint = 1200
;
CONCATENATE (Table2)
LOAD
'G2' as MyField,
sum(Quantity) as result
RESIDENT
Table1
WHERE
Product = 'QP01' and (SalesPoint = 1200 or SalesPoint = 1400)
;