Previous Row Comparison

Last post Tue, Feb 14 2012 7:37 PM by Terry. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • Sun, Feb 12 2012 8:33 PM

    • Terry
    • Top 150 Contributor
    • Joined on Wed, Dec 8 2010
    • Adelaide
    • Posts 10

    Previous Row Comparison

    Hi All, I was just wondering if anyone would have any suggestions as to how to do something such as the following. If I have a column which looks as follows: 
    Availability Cause
    Unplanned Event
    Online Time
    Online Time
    Unplanned Event
    Online Time
    Unplanned Event
    Online Time
    Unplanned Event
    Online Time

     

    I want to create a calculated column alongside of this one which does something such as the following:  Case When RowPrevious([Availability Cause])=”Online Time” and [Availability Cause]=”Online Time” then 0 else 1 End The problem I am having is making a function do something such as I have indicated in the “RowPrevious”. I am unsure how to make Spotfire return the value in a row previous to the current. I hope this makes sense. Thankyou in advance  Terry Pitt

     

  • Mon, Feb 13 2012 3:42 AM In reply to

    • EranS
    • Top 10 Contributor
    • Joined on Mon, Oct 12 2009
    • Israel
    • Posts 376

    Re: Previous Row Comparison

    Hi Terry, Try this calculation : max([Availability Cause]) OVER (Previous(RowId())). This should work for data preparation. Inside a cross table or other Vis (custom expression) the syntax will differ. Best Regards, Eran
  • Mon, Feb 13 2012 7:13 PM In reply to

    • Terry
    • Top 150 Contributor
    • Joined on Wed, Dec 8 2010
    • Adelaide
    • Posts 10

    Re: Previous Row Comparison

    Hi Eran, Thank you for your prompt reply. I have had no luck with this so far although I will continue trying. Keep getting the response that rowID() is not valid in calculated columns. I have also tried BaseRowID which seems more effective in my application due to its ability to dynamically change with filter modifications.  Regards, Terry

     

  • Tue, Feb 14 2012 2:32 AM In reply to

    • EranS
    • Top 10 Contributor
    • Joined on Mon, Oct 12 2009
    • Israel
    • Posts 376

    Re: Previous Row Comparison

    Hi Terry,

     

    Try first creating a calculated column that will be based on the function rowid() as [row_id]

    Then use this field in your formula.

     

    Best Regards,

    Eran

  • Tue, Feb 14 2012 7:37 PM In reply to

    • Terry
    • Top 150 Contributor
    • Joined on Wed, Dec 8 2010
    • Adelaide
    • Posts 10

    Re: Previous Row Comparison

    Great Eran,

    Got what I need working now thanks to your last reply!

    Much appreciated

Page 1 of 1 (5 items)

Spotfire's interactive information visualization and analytic solutions give users a remarkable experience for quickly and easily querying data and reporting results for superior business intelligence. From portfolio management and customer retention programs to key processes such as CRM, marketing, research, bioinformatics, yield and asset management and design for manufacturing, enterprises around the world rely on Spotfire's business analytics software to improve operational performance.

©Copyright 2000-2011 TIBCO Software Inc | Privacy Policy | Terms of Use I Blog I Contact Us I Content Center