Skip to content Skip to sidebar Skip to footer

Use Of Previous() Function In Reverse Date Sorted Data In Ssrs?

I'm trying to use the Previous() function in a report indicator to display an up or down arrow depending on if there has been an increase or decrease from last year. This works fin

Solution 1:

I used previous in a "reverse" way:

In my example I used the previous function for period and valuesale data, and normal value for previous data.

Also I hide the first row (no meaning to show), and show the last period at the footer

To control visibility of the first row use: =Previous(Fields!fiscalmonth.Value) is Nothing

enter image description here

enter image description here

Solution 2:

When you are sorting by date in the descending order, it seems instead of the previous value you need the next value. SSRS doesn't provide any next function unlike Crystal.

Here what you can try is creating a queried parameter which takes the value of field "Value" and write an expression like :

Parameters!Value.Value((RowNumber(nothing)) - Parameters!Value.Value((RowNumber(nothing)+1)

The main idea is you can get the value as an indexed array for example Parameters!Value.Value(i) will give you the ith record of the "Value" field.

And you'd need function RowNumber to get the running count of rows.

enter image description here

Post a Comment for "Use Of Previous() Function In Reverse Date Sorted Data In Ssrs?"