Hello,
I have a union report that I have created a pass through variable as the fiscal year parameter. I have created the variable in the sub report that is rendered 1st (last report on the list) and the variable is a CHAR type, I have called it @FiscalYearParam@ and the default is @YEAR@.
In that 1st sub report I then have the filter as FiscalYear = @FiscalYearParam@ and this works great. The issue is that on the second sub report I want Last Fiscal Year, so the filter needs to be FiscalYear = @FiscalYearParam@ -1
This in fact does not work and I'm not sure how to solve this, can anyone provide any suggestions?
Cheers
Leo
Tags:
Permalink Reply by Stephen Coull on December 5, 2011 at 11:26pm Leo,
I would think that the variable type should be numeric type so that it can handle the arithmetic of -1.
Permalink Reply by Leo Demarce on December 6, 2011 at 4:02pm Thanks for that Stephen,
I tried that and still no success, the result is no data so it's not passing on the right value, and I don't have any way of discovering what value is being passed on.
Permalink Reply by Terence Hinrichsen on December 8, 2011 at 3:39pm Hi Leo,
And if you switch to SQL Output mode (on Home Object, Right-click and select Switch Output Mode) In Report Manager, then at least it will give you the SQL query being passed and then you should be able to see what is being passed.
What I have done in the past to bridge this problem is using my PT Variable as part of my join script and that allowed my to do the calculation. You then need to remove the filter on the sub report and add the WHERE clause on your Container source.
Just a thought, use it .. . don't use it. ;-)
Permalink Reply by Leo Demarce on December 8, 2011 at 4:55pm Thanks Terrence, thanks for the feedback.
What I ended up having to do is modify my source view to change the fiscal year from a CHAR to a NUMERIC value using a convert function.
Why I use this approach is because I need to be able to use the source view for multiple reports. In your case this would be fine for 1 report, but then I would need to create the modification on every script.
Does that make sense?
Permalink Reply by Terence Hinrichsen on December 12, 2011 at 11:16am © 2012 Created by Admin.