Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I want to use the field's from two tables's within a Load statement, but the table's are not related. Basically I want to show entries within 0 -3 Month, 3 -6 month's, 6month-1 Year, 1 year - 2 year. What should I do?
Thanks in Advance
Hey,
u have 2 possibilities ..
1:::: concatenate the tables and keep a flag field for the bucket u want to create (If u donot have common key for both tables..).
2:::: use join toget the data from 2 tables if u have any common key in both the tables
tblGROUP:
LOAD
Invoice,
invoice_date,
val,
qty,
'0 - 3 mths' as Period
FROM TABLE1
WHERE invoice_date < date(addmonths(date(monthstart(today()),'MMM-YYYY'),1)) and invoice_date >= date(addmonths(date(monthstart(today()),'MMM-YYYY'),-2)) ;
Concatenate
LOAD
order_no, // or invoice_no
Order_date, // or invoice_date
val,
qty,
'3 - 6 mths' as Period
FROM TABLE2
WHERE invoice_date < date(addmonths(date(monthstart(today()),'MMM-YYYY'),-3)) and invoice_date >= date(addmonths(date(monthstart(today()),'MMM-YYYY'),-5));
Concatenate
Etc………………
let me know how you get on,
regards,
FC