title: Saved search in NetSuite returning multiple lines for each vendor bill despite Main Line is True in criteria
body: <p>I am creating a performance metrics report for our AP Team. They want to see processing dates for vendor bills from received to approved and every point in between so they can see where bottlenecks are occurring and the like, along with the user/approver doing each step. We have an approval workflow in place that routes the vendor bills through first and second approvals. There are also likely to be rejections that also need to be captured.</p>
  <p>These are the columns we envision the search to have with one vendor bill per row. The most recent date at each stage should be pulled so, if the bill has to be routed back for corrections and then submitted for approval again, there would still only be one line per vendor bill.</p>
  <p>Subsidiary | Transaction Status | Date Received | Date Processed | Processed By | Date Submitted for First Approval | Name | Date Submitted for Second Approval | Name | Date Approved | Name | Date if Rejected | Name|</p>
  <p>I currently have the following in the results of a Transaction Saved Search. [I have omitted columns that are irrelevant to my question.] My problem is that the search is returning multiple lines per document number, one line for each instance of the date. In other words, the First Vendor Approval date and Name is on one line then the First Subsidiary Approval date and Name is on the next line, etc. <strong>What am I missing that will get the results to show on one line per document number?</strong> Let me know if you need additional information.</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>FIELD</th>
  <th>FORMULA</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>Document Number</td>
  <td></td>
  </tr>
  <tr>
  <td>Type</td>
  <td></td>
  </tr>
  <tr>
  <td>Subsidiary</td>
  <td></td>
  </tr>
  <tr>
  <td>Name [Vendor]</td>
  <td></td>
  </tr>
  <tr>
  <td>Vendor Bill Date</td>
  <td></td>
  </tr>
  <tr>
  <td>Due Date</td>
  <td></td>
  </tr>
  <tr>
  <td>Approval Status</td>
  <td></td>
  </tr>
  <tr>
  <td>Date Created</td>
  <td></td>
  </tr>
  <tr>
  <td>Created By</td>
  <td></td>
  </tr>
  <tr>
  <td>Formula (Date/Time)</td>
  <td>CASE WHEN {workflowhistory.stateinfo} = 'Pending First Vendor Approval' THEN {workflowhistory.dateenteredstate} END</td>
  </tr>
  <tr>
  <td>Formula (Text)</td>
  <td>CASE WHEN {workflowhistory.stateinfo} = 'Pending First Vendor Approval' THEN {systemnotes.name} END</td>
  </tr>
  <tr>
  <td>Formula (Date/Time)</td>
  <td>CASE WHEN {workflowhistory.stateinfo} = 'Pending First Subsidiary Approval' THEN {workflowhistory.dateenteredstate} END</td>
  </tr>
  <tr>
  <td>Formula (Text)</td>
  <td>CASE WHEN {workflowhistory.stateinfo} = 'Pending First Subsidiary Approval' THEN {systemnotes.name} END</td>
  </tr>
  <tr>
  <td>Formula (Date/Time)</td>
  <td>CASE WHEN {workflowhistory.stateinfo} = 'Approved' THEN {workflowhistory.dateenteredstate} END</td>
  </tr>
  <tr>
  <td>Formula (Text)</td>
  <td>CASE WHEN {workflowhistory.stateinfo} = 'Approved' THEN {systemnotes.name} END</td>
  </tr>
  <tr>
  <td>Formula (Date/Time)</td>
  <td>CASE WHEN {workflowhistory.stateinfo} = 'Rejected' THEN {workflowhistory.dateenteredstate} END</td>
  </tr>
  <tr>
  <td>Formula (Text)</td>
  <td>CASE WHEN {workflowhistory.stateinfo} = 'Rejected' THEN {systemnotes.name} END</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>This is the Criteria I have set.</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>PARENS</th>
  <th>FILTER</th>
  <th>DESCRIPTION</th>
  <th>FORMULA</th>
  <th>PARENS</th>
  <th>AND/OR</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td></td>
  <td>Type</td>
  <td>is any of Bill, Bill Credit</td>
  <td></td>
  <td></td>
  <td>And</td>
  </tr>
  <tr>
  <td></td>
  <td>Main Line</td>
  <td>is true</td>
  <td></td>
  <td></td>
  <td>And</td>
  </tr>
  <tr>
  <td></td>
  <td>Date Created</td>
  <td>is not before 1/1/2021</td>
  <td></td>
  <td></td>
  <td>And</td>
  </tr>
  <tr>
  <td>(</td>
  <td>Formula (Text)</td>
  <td>is 1</td>
  <td>CASE WHEN {workflowhistory.stateinfo} = 'Pending First Vendor Approval' THEN '1' END</td>
  <td></td>
  <td>Or</td>
  </tr>
  <tr>
  <td></td>
  <td>Formula (Text)</td>
  <td>is 2</td>
  <td>CASE WHEN {workflowhistory.stateinfo} = 'Pending First Subsidiary Approval' THEN '2' END</td>
  <td></td>
  <td>Or</td>
  </tr>
  <tr>
  <td></td>
  <td>Formula (Text)</td>
  <td>is 3</td>
  <td>CASE WHEN {workflowhistory.stateinfo} = 'Approved' THEN '3' END</td>
  <td></td>
  <td>Or</td>
  </tr>
  <tr>
  <td></td>
  <td>Formula (Text)</td>
  <td>is 4</td>
  <td>CASE WHEN {workflowhistory.stateinfo} = 'Rejected' THEN '4' END</td>
  <td>)</td>
  <td></td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>Thanks in advance for any help anyone can offer!</p>