Bud
Bud

Reputation: 781

NetSuite Saved Search Showing Inside Sales Rep If There Is One

I'm trying to do a saved search in NetSuite that returns all of the customers in a particular state and, for those which have an Inside Sales Rep, the name of that rep.

But if I specify Sales Team Role = Inside Sales Rep in the criteria, the result only contains customers who have an Inside Sales Rep (and we have some that do not).

If I don't specify the Sales Team Role in the criteria but list Sales Team Role and Sales Team Member in the Results, then I get every customer, but a row for every sales team member, with their role - so multiple lines per customer. I don't want that.

I just want a line in the results for each customer and, if there is an Inside Sales Rep on that customer, that person's name.

Any suggestions?

Upvotes: 0

Views: 414

Answers (1)

Gerard ONeill
Gerard ONeill

Reputation: 4102

Basically, you need a left join ;).

Instead, you can use a formula to return either the sales rep if the role is inside sales, or null, or null if there is no sales rep. Then you aggregate it using maximum.

Or you can use the rank function (using the formula above within the rank syntax), selecting where rank = 1. This allows you to save your aggregation for when you need it, at the expense of clarity.

Upvotes: 0

Related Questions