Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Im trying to find the last day every product was sold in a sales file, please help me
EG I need to assign the latest invoiced date of each product
Regards
Jörgen
Jörgen,
Something like this:
JOIN (Sales) LOAD
ProductId,
max(InvoiceDate) as LastInvoiceDate
RESIDENT Sales
GROUP BY ProductId
Jörgen,
Something like this:
JOIN (Sales) LOAD
ProductId,
max(InvoiceDate) as LastInvoiceDate
RESIDENT Sales
GROUP BY ProductId
On the script
Data:
LOAD Product, Date
FROM yourfile;
LOAD
Id ,max(Date) as LastDate
RESIDENT Data
GROUP BY Id
;
Then use LastDate as a new field.
Jean-Jacques
Hello plokijuh.
I wonder if you could post your application to be analysed.
I'd like to look your application to be more effective.
Thanks.
Huberto.
Thanks it worked, but I got the answer in a numeric way like 39084 how do i make date out of this again?
Regards
Jörgen
Open the property windows of your graphic,
go to NOMBRE ( maybe number in english, sorry a french version), and clik on date date & hour (if so).
Jean-Jacques
Hi.
I think you could have the same information in a simple expression, but if create this field in your table during the load is better, I suggest you to use the function date with the format that you want.
JOIN (Sales)
LOAD
ProductId,
date(max(InvoiceDate), 'DD/MM/YYYY') as LastInvoiceDate
RESIDENT
Sales
GROUP BY ProductId;
Give a look at my suggestion and let me know if it helped you.
Huberto.
how about FirstSortedValue(InvoiceDt,-InvoiceDt), then you don't need to do anything at script level.