Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm trying to load, for all of my customers, the first date they ordered.
I have 2 tables which are basically as following :
ORDERS :
LOAD
order_id,
customer_id,
order_date,
order_turnover
FROM QVD/orders.qvd
CUSTOMERS :
LOAD
customer_id,
customer_name,
customer_registration_date
FROM QVD/customers.qvd
I'd like to add a column in my "CUSTOMERS" table which would be the first order date (i want it to be pre-calculated in the script, not calculated within the report).
Thanks in advance for your help !
Damien
Try a grouped by load with FirstSortedValue aggregation:
Add
left join (CUSTOMERS) LOAD
customer_id,
FirstSortedValue(order_date, order_date) as FirstOrderDate
resident ORDERS group by customer_id;
to your script, after the above posted lines.
I assume that order_date is of Date type with numerical representation.
Hope this helps,
Stefan
Try a grouped by load with FirstSortedValue aggregation:
Add
left join (CUSTOMERS) LOAD
customer_id,
FirstSortedValue(order_date, order_date) as FirstOrderDate
resident ORDERS group by customer_id;
to your script, after the above posted lines.
I assume that order_date is of Date type with numerical representation.
Hope this helps,
Stefan
Thank you very much ! It works perfectly !