Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello All,
I'm sure this is an easy one for you.. I have a field where there should only ever be one value, but in the case of two I want to only want to select one.
I was thinking a min(site) or firstsortedvalue, but I don't have a date field or anything that I can use. I'm not bothered which one of the two values it uses, aslong as I only get one - so I was thinking of doing it within my load script.
I hope you can help me!
Kind Regards,
Dayna
Hello Dayna,
Use MaxString() that works as any other aggregation function (needs a group by in the script and so).
Hope that helps.
you can use Firstsortedvalue(),Firstvalue()
How do I use it within the load script, as I keep getting errors?
Firstsortedvalue I couldn't get to work due to the lack of a sort weight field as above, so looking at firstvalue().
LOAD
DISTINCT SHIP_TO_CUSTOMER,
Firstvalue(SHIP_TO_CUST_GRP5_DESC) as SHIP_TO_CG5
RESIDENT SHIP_TO GROUP BY SHIP_TO_CUSTOMER; //OK
Hello Dayna,
Use MaxString() that works as any other aggregation function (needs a group by in the script and so).
Hope that helps.
That's what I wanted! Cheers again Miguel!