Aggregating a column in a dataset based on value in another column in the same dataset in ssrs

  • I am trying to aggregate a part of a dataset to be used as an expression. I have a dataset called Weekly with some columns of with 1 is SalesSelling and another is TimeGroup, Sales as sales data values while Timegroup has String datavalues such as LW = Last Week, TW = This Week, LY= Last year etc I want to Aggregate the Sales column when the TimeGroup Column Has the LW values using an expression. I have tried:

    =Switch(Fields!SalesSelling.Value "LW", Sum(Fields!SalesSelling.Value))

    =IIF(Fields!TimeGroup.Value = "LW",Sum(Fields!SalesSelling.Value),0)

    However they don't work does anyone know how to accomplish this.

    my intension is to calculate percentage variance for last week ant this week however I need summations first.

  • I think you want:

    =Sum(IIF(Fields!TimeGroup.Value = "LW",Fields!SalesSelling.Value,0))

Viewing 2 posts - 1 through 1 (of 1 total)

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