2 Replies Latest reply: Aug 15, 2014 10:44 AM by Srikanth P RSS

    Subtracting from FirstSortedValue



      Thanks to the forum I been given the following expression to use on text_object:


      =if(status = 16, FirstSortedValue(updatetxt_test, -udindex_test), FirstSortedValue(updatetxt_test, -udindex_test))


      status 16 = Close Calls

      status 15 = Resolved Calls

      updatetxt_test = Call Text

      udindex_test - Unique value of call text


      Example Data:


      Callref    udindex  updatetxt                                   status

      221312   0           User requires New Account         16

      221312   1           User account created                  16

      221312   2           Closed by System Administrator  16

      221313   0           User requires Office Install           15

      221313   1           Office 2010 installed on machine  15


      The issue I have is that when a call is closed the last call text always shows as 'Closed by System Administrator' where as when the call is Resolved the last call text shows the resolution text.


      Is it possible to amend the above expression so that when the status = 16 the max udindex is taken away by 1, therefore as in the example above callref 221312 will show udindex field 1 instead of udindex field 2?




      Jon Ditchfield

        • Re: Subtracting from FirstSortedValue
          ioannis giakoumakis

          =if(status = 16, FirstSortedValue(updatetxt_test, -udindex_test),

                                 FirstSortedValue(updatetxt_test, -udindex_test)


          It looks like your true and false parts of the if statement are exactly the same. Is this working as expected?

          Anyway, -1 would do it I guess :

          =if(status = 16, FirstSortedValue(updatetxt_test, -udindex_test) - 1,

                                 FirstSortedValue(updatetxt_test, -udindex_test)


          • Re: Subtracting from FirstSortedValue
            Srikanth P

            Hi Jon, In the FirstsortedValue there is one optional parameter Sort Weight.


            Try Like below:

            if(status = 16, FirstSortedValue(updatetxt_test, -udindex_test,2), FirstSortedValue(updatetxt_test, -udindex_test))