28 Replies Latest reply: Oct 11, 2018 9:25 AM by Stefan Wühl RSS

    get the last possible value with expression

    Angel Tomov

      Hello guys, I have been struggling the last few days with the following situation.


      We have 2 tables, 1 is with repayments for Loans, and the second table is with Statuses of each loan.



      first table is like this

      Loan ID, Loan Type, Payment Date, Payment


      the second table is like this

      Loan Id, Loan status, Date change




      So i have build a set analysis expression to get the sum between 2 dates .


      In my straight table i have

      Loan Id, Payment date and sum of payments. Everything is working great


      But when i add FirstSortedValue(LoanStatus,-DateChange) the expression returns results for ALL Loans, and thus i get quite a few empty fields, but it should return the value only for the loans that have payments in this period....



      How can I get the last status ?