We recommend switching to the latest versions of Edge, Firefox, Chrome or Safari. Using Internet Explorer will result in a loss of website functionality.

Date difference between two rows (current and previous), data in different columns

Comments

2 comments

  • Avatar
    Infogix Support
    Originally posted by: awilliams1024

    Hi Maria,
    this should do what you want:

    node:Test_Data
    bretype:core::Static Data
    editor:Label=Test Data
    editor:sortkey=5c90e6226a6a5148
    output:@40fe6c55598828e5/=
    prop:StaticData=<<EOX
    Start Date:date,End Date:date
    1987-7-13,1988-04-10
    1988-04-11,1988-04-12
    1988-04-14,1988-06-21
    1988-06-22,1089-04-09
    EOX
    editor:XY=270,100
    end:Test_Data
    
    node:Filter
    bretype:core::Filter
    editor:sortkey=5c90e76a14a01edc
    input:@40fd2c74167f1ca2/=Test_Data.40fe6c55598828e5
    output:@40fd2c7420761db6/=
    prop:Script=<<EOX
    if firstExec then {
    	previous_End_Date = dateAdjust('Start Date',-1,"days")
    } 
    
    date_Difference = dateSubtract('Start Date', previous_End_Date)
    
    if date_Difference == 1 then {
    	date_Interval = "Normal"
    } else {
    	date_Interval = "Abnormal"
    }
    
    emit *, date_Interval as "Date between Adjacent Periods"
    ## debug fields
    #emit previous_End_Date, date_Difference
    
    previous_End_Date = 'End Date'
    
    EOX
    editor:XY=410,100
    end:Filter
    0
    Comment actions Permalink
  • Avatar
    Infogix Support
    Originally posted by: MariaB

    Thanks so much! Working perfectly
    0
    Comment actions Permalink

Please sign in to leave a comment.