Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a table with the following
ProductID Product Description
M001 XYZ123
M001 XYZ123/5
M001 XYZ123/6
The description does not really matter, but i need to keep 1 Product Description anyway
I tried using MAXSTRING(Product Description) AND GROUP BY ProductID, but it aint working
Product:
LOAD
ProductID
Product Description
FROM [Product.qvd](qvd);
Thanks
Try the firstvalue function:
Product:
LOAD
ProductID
firstvalue([Product Description])
FROM [Product.qvd](qvd)
group by ProductID;
Try the firstvalue function:
Product:
LOAD
ProductID
firstvalue([Product Description])
FROM [Product.qvd](qvd)
group by ProductID;
Invalid Expression is returned in the Script Error
I got it working thanks G.
I had other fields in the table which were causing it not to work.
Can the FIRSTVALUE Function be used more than once in the same table?
Thanks again
Sure, you can use the firstvalue function on any field as long as they are aggregated on the same fields by the group by clause. It's just another aggregation function like sum, count, avg, concat etc.
Thanks