Search code examples
sql-serverreporting-servicesssrs-2016reporting-services-2016

Is it possible to use LookupSet/Lookup with Running Value in SSRS


This is my first question on StackOverflow so apologies if there is not enough appropriate information.

Rather than having four different tables that I try to position 'just so' so that they look like one table, I was hoping to have all of my data in one visible table and hide the rest.

To do this I was trying to use LookupSet/Lookup with Running Value (I need a cumulative figure for each fortnight from a start date).

I have used the following code which supplies me with figures in the table - however the figures seem to be nearly double what they actually are.

=Lookup(Fields!StartFortnightDate.Value, Fields!StartFortnightDate.Value, 
Fields!RowIdentifier.Value, "KPI004")

Is it possible to use Lookup with RunningValue? It won't let me use ReportItems either its obviously only pulling from the first box and therefore is just repeating the first figure again and again.

Any help, guidance, or even a simple "it's not possible" would be appreciated.

Edited to add more information as suggested:

It's difficult to add example data without worrying about data protection etc.

Report design is currently: ReportDesign

Each table has it's own dataset - I'm trying to get them all into one table.

Lets say the first dataset is number of cars sold in each fortnight. The second dataset (table) is number of meetings held. The third dataset is number of days weather was sunny/cloudy/rainy etc.

(This obviously isn't what the datasets are, but I'm trying to show that they don't actually relate to each other that much and therefore can't all be in the same script)

All datasets have a table of the fortnightly dates within that quarter, my hope was to get one table that showed the cumulative figures of each item even though they're not in the same dataset - the tables are all grouped by the StartOfFortnightDate.

The script =RunningValue(Fields!NumberOfFordCarsSold.Value, Count, Nothing) and similar works fine in the separate tables, however if I add a row to the top table and try to use RunningValue with Lookup it doesn't work.

When I used the script mentioned at the top (Lookup script) I get inflated figures (top row of this image) compared to the expected figures (bottom row of the image): IncorrectAndCorrectFigures

Apologies if this doesn't make sense, it's likely that my complete confusion in trying to find the answer is coming across in the question.


Solution

  • If the resulting datasets are all similar then why can you not combine them?

    From the output they seem to be just Indicator & Date.

    Add an extra column to indicate which set of data each row belongs to (Cars Meetings etc), this might help with grouping rows in the report.