I’m having trouble trying to use the result of a Min or Max in a Where statement. I get a syntax error and I guess it actually makes sense but I’m not sure how to work around this.

Attached is a sample of the report.

It’s a crosstab by Start Date by Name, with Week Number across the top. What I want to do is calculate the difference in Pct between the first Week Number (always 0) and the latest Week number (Week 2 in the first row, Week 1 in the second row, Week 0 in the 3rd row).

So my new column needs to show:

2.87% in row 1, 1.22% in row 2, 0 in row 3

I have created variables for Min Wk and Max Wk (as shown) but when I try and calculate my variance such as Where ( = ) I get a syntax error.

N.B. when using the variable editor, I am not actually offered an “=” after the Where so I am not really surprised I get a syntax error.

Any help greatly appreciated

Report 3a.pdf (32.0 KB)

**Reporter** *(BOB member since 2006-11-09)*