1
votes

I have two columns in my function which are Actual_Forecast and Month. On my reports I have a column for each month Jan, Feb, Mar etc.....

I would like to add an expression in the January (and the other columns) header to show if the month is actual or forecast, Jan = Actual, Dec = Forecast.

So if the field = Jan then show what is in the Actual_Forecast

I've tried a number of things but expressions and SSRS is still very new to me.

I thought it would be something like =Fields!date_month_name.Value = "October", = Fields!actual_forecast.Value

2

2 Answers

1
votes

You could set your Expression in each of the column header text boxes. Say for January

= IIF(MonthName(Month(Today()) = "January", "Jan - Actual", "Jan -Forecast")

Response To your Comment

You might try in each of the header text boxes. Again an example for January but each header would have the appropriate moth name.

= IIF(Month(Today()) <= Month(Fields!Date.Value), "Jan - Actual", "Jan -Forecast")
0
votes
  1. You can convert your month value as a first date of the month.
  2. After that use Month function to get integer month value
  3. Can compare your month input value to current month value
  4. If your month value less than or equal to current month it will display 'Actual' otherwise 'Forecast'

Eg: if your month value is 'Sep'. from above step,

  1. 01-Sep-2019
  2. Month("01-Sep-2019") will return 9.
  3. Month("01-Sep-2019")<=Month(Now)
  4. IIf(Month("01-Sep-2019"<=Month("12-Sep-2019"),"Actual","Forecast")
=IIf(Month("01-"+Fields!MonthValue.Value+"-"+CStr(year(now)))<=Month(now),"Actual","Forecast")

Use above code with your month value field in header.