2 Replies Latest reply on Jan 8, 2014 4:45 AM by RehmanAkram

    Urgent Help in Portal Row calculation

    RehmanAkram

      Title

      Urgent Help in Portal Row calculation

      Post

           Hello,

           I have Date field in the portal raw and i want when i create new row so i can get Day's gap calculated from the same field between creating row so i can find out how many days gap there was. 

           I.e

           First row               = Date 20/12/2013

           Second row        = Date 25/12/2013

           calculation field = Gap Day's =   5

           how can i do this please help.

        • 1. Re: Urgent Help in Portal Row calculation
          philmodjunk

               Since the data is in two different records, there are several options that can access the date from the preceding record in order to subtract the two dates and get the elapsed time in days.

               GetNthRecord can access the preceding record:

               Define cPrevDate as:

               IF ( Get ( RecordNumber ) > 1 ; GetNthRecord ( Datefield ; Get ( RecordNumber ) - 1 ) )

               Define cElapsedDays as: IF ( NotIsEmpty ( cPrevDate ) ; DateField - cPrevDate )

               But this isn't always practical. You may also want to set up a self join relationship that matches to the preceding record. Such a relationship can make it possible to either refer directly to the date field from the previous record in your calculation or you can use a date field with an auto-enter setting that copies the date from the preceding record so that you can compute the difference.

          • 2. Re: Urgent Help in Portal Row calculation
            RehmanAkram

                 would it be possible to get demo sample from you ? as i can not do it after many attempts Phil