Skip to Content
author's profile photo Former Member
Former Member

Group on a formula that has next/previous

I have the below formula(@type). I am unable to see the formula in the group expert selection window.

I'm assuming grouping on a formula with next/previous is not allowed, nay workaround or suggestion.

Thanks in advance, John




else "Unknown"

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Jan 28, 2014 at 06:29 PM

    Hi John,

    That's right - you cannot create a group off of a formula that uses Print-time functions (next and previous apparently are).

    The best way of course is to use Database Specific functions ( read somewhere about Lead and Lag I suppose) and use a Command Object. (Jamie just mentioned it!)

    A dirty way is to create a comma separated string of the formula field's result for each Group > Pass it to a Subreport > 'Split' the values at each group level and then create a group off of this formula.

    There's however the overhead of running the same query twice.


    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 28, 2014 at 06:25 PM

    hi John,

    next and previous are not available for grouping. these are done too late in the evaluation time.

    i would suggest that you look into LEAD & LAG for your database and then create a Command object using those functions...i.e. you create separate field values in your Command representing lead & lag.

    here's a video using sap hana that will describe lead & lag some more.


    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.