Expression help for YOY dates

  • So my report needs changing again, we are measuring something differently from today and so all previous data would be compared to our old stat numbers but from today it will be from the new method.

    So total app need to be divided by the visits this year, and then divided by the same criteria for last year.

    The expressions themselves stand alone work ok (well for this year it does), but combining them I get an error:

    The value expression for the textrun 'Textbox37' uses a First, Last or Previous aggregate in an outer aggregate. These aggregate functions cannot be specified as nested aggregates.

    Code is below I have got so far:

    =sum(Fields!Apps_Made.Value)/ iif(First(Fields!THEDATE.Value, "Visits") >= "2016-04-01", lookup(Fields!THEDATE.Value, Fields!THEDATE.Value, Fields!AA_Visits.Value, "Visits"), lookup(Fields!THEDATE.Value, Fields!THEDATE.Value, Fields!GA_Visits.Value, "Visits"))

    /Sum(Fields!Apps_Made_Previous_Year.Value / iif(First(Fields!THEDATE.Value, "Visits") >= "2016-04-01", lookup(Fields!THEDATE.Value, Fields!THEDATE.Value, Fields!AA_Visits_Previous.Value, "Visits"), lookup(Fields!THEDATE.Value, Fields!THEDATE.Value, Fields!GA_Visits_Prev.Value, "Visits")) -1

    Any help is appreciated, I managed to get much further than I do normally.

  • Hi Kazmerelda,

    Looks like you are missing the right bracket for:

    Sum(Fields!Apps_Made_Previous_Year.Value

  • In Reporting Services, Expression can contain calls to nested aggregate functions with the following exceptions and conditions:

    1. Scope for nested aggregates must be the same as, or contained by, the scope of the outer aggregate. For all distinct scopes in the expression, one scope must be in a child relationship to all other scopes.

    2. Scope for nested aggregates cannot be the name of a dataset.

    3. Expression must not contain First, Last, Previous, or RunningValue functions.

    4. Expression must not contain nested aggregates that specify recursive.

    You should 1st divide and then get the sum.

  • I think I was staring at it for too long, HOW can I keep missing brackets. I really am a chud.

    Thank you both very much, actually the explanation was helpful. I fixed that one and then another I broke as well. Happy days!

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply