Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with expression in SSRS

Status
Not open for further replies.

staceyn

Technical User
Nov 19, 2004
107
US
Hello,
I am using Visual studio 2005 against an infomix odbc datasource for my report.
I am trying to get previous weeks data to display.
I have a parameter to prompt for sales week and have that added to my table filters.
I then have the following formulas to grab the week entered as well as the previous 3 weeks.

week1
=IIF(Fields!wx_week.Value=Parameters!SalesWeek.Value,Fields!wx_week.Value,0)

week2
=IIF(Fields!wx_week.Value=Parameters!SalesWeek.Value,Fields!wx_week.Value -1,0)

week3
=IIF(Fields!wx_week.Value=Parameters!SalesWeek.Value,Fields!wx_week.Value -2,0)

Week4
=IIF(Fields!wx_week.Value=Parameters!SalesWeek.Value,Fields!wx_week.Value -3,0)

I then have formulas to bring back the sales dollars if they fell in the appropriate sales week.

Week1SalesDollars
=IIF(Fields!wx_year.Value=Parameters!SalesYear.Value and Fields!wx_week.Value=Fields!Week1.Value,Fields!sl_price.Value,0)

Week2SalesDollars
=IIF(Fields!wx_year.Value=Parameters!SalesYear.Value and Fields!wx_week.Value=Fields!Week2.Value,Fields!sl_price.Value,0)

Week3SalesDollars
=IIF(Fields!wx_year.Value=Parameters!SalesYear.Value and Fields!wx_week.Value=Fields!Week3.Value,Fields!sl_price.Value,0)

Week4SalesDollars
=IIF(Fields!wx_year.Value=Parameters!SalesYear.Value and Fields!wx_week.Value=Fields!Week4.Value,Fields!sl_price.Value,0)

When I add the week1, week, week3, week4 formulas they come back on the report with the proper results. (ie week 23,22,21,20)

When I add the Week1SalesDollars,Week2SalesDollars,Week3SalesDollars,
Week4SalesDollars formulas to the report, I get the value for Week1SalesDollars, but all other week*SalesDollars come back as zero.

Any ideas on why week1salesdollars works but none of the other formulas work?

Any help would be greatly appreciated.

Thanks,
Stacey

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top