
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to pick one value
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
Accepted Solutions
.png)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Dayna,
Use MaxString() that works as any other aggregation function (needs a group by in the script and so).
Hope that helps.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
you can use Firstsortedvalue(),Firstvalue()

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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().


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
LOAD
DISTINCT SHIP_TO_CUSTOMER,
Firstvalue(SHIP_TO_CUST_GRP5_DESC) as SHIP_TO_CG5
RESIDENT SHIP_TO GROUP BY SHIP_TO_CUSTOMER; //OK
.png)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Dayna,
Use MaxString() that works as any other aggregation function (needs a group by in the script and so).
Hope that helps.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That's what I wanted! Cheers again Miguel!
