Tricky way to get index of row in query rule

Dear all,

I am trying to get data from the DB to show milestone and trying to figure out how to build a query rule to return the index of the last non-null value a list of rows .  See the attached picture.  How can I code this query rule to return the last non-null index of the approverDecision column?  In this case, the index is 2 (the last non null approverDecision row).

Thanks

  Discussion posts and replies are publicly visible

Parents
  • Actually I'd take a different approach. Leverage the power of the database and create a VIEW that selects all of the data you want returned from the row, and in the selection criteria use the MAX(Index) WHERE "ApproverDecision' IS NOT NULL AND 'ApproverDecisionDate' IS NOT NULL to select the one row you want returned. Now you have your VIEW it'll be straightforward to simply return the content of that VIEW into Appian.

Reply
  • Actually I'd take a different approach. Leverage the power of the database and create a VIEW that selects all of the data you want returned from the row, and in the selection criteria use the MAX(Index) WHERE "ApproverDecision' IS NOT NULL AND 'ApproverDecisionDate' IS NOT NULL to select the one row you want returned. Now you have your VIEW it'll be straightforward to simply return the content of that VIEW into Appian.

Children