Back from Perspectives today. Didn't see a response to this yet so I will jump in.
Yes, you definitely CAN use the Report-Filter values. But you must first pass it through an aggregate function (like Min or Max) and then use the result of that. Technically it is cheating but it works.
Below are some notes from a text file I keep handy for cut/paste in reports where I need a filter date range in the header. The principle is the same for any situation where filter info is needed as well as setting bogus true/false flags for turning on/off things like detail or group bands.
Alas, this will soon be obsolete knowledge with 8.0.
-Todd C.
------------------------------------------------------------------------------------------------------------------------
PrtFilter = Report-Filter() ! (system function)
ParseFilter = Minimum(PrtFilter) ! must pass thru aggregate due to indirect use of function
! In the following adjust the starting point (60) as needed depending on the filters
! and the position of the first date test
Start-From: INDEX(ParseFilter,'equal to',60) + 9
Start-To: INDEX(ParseFilter,'equal to',Start-From) + 9 SEE NOTE BELOW!!!!!
FromDate: SUBSTRING(ParseFilter,Start-From,10)
ToDate: SUBSTRING(ParseFilter,Start-to,10)
FromDate and ToDate are the dates you can use in the heading of the report. Or if you have only one date you can skip the other.
Please note that the starting "off-set" (in this case 60) may be different for your set of filters. Also the above example assumes the end date filter is the next one following the start date filter. Report filters, as returned by the REPORT-FILTER function are phrased written out in words not using symbols (like + < >) so all comparisons end in "equal to" (such as "less than of EQUAL TO") So this makes "equal to" a good marker to search on for dates.
NOTE!!!!
As of 2/10/04 there is a BETTER WAY to determine the starting location for each date that does not "break" if you add new filters ahead of the dates. So you may either find the starting position for dates by "Equal To" locaiton or.......
Start-From: INDEX(ParseFilter,'/') - 2
Start-To: INDEX-NTH(ParseFilter,'/',3) - 2
What these do is to find the first "slash" and backup two characters to the start of the date. Then the next one finds the third "slash" using the INDEX-NTH function and does the same. If you had several date ranges just set the NTH part accordingly. The only reason this method might not work is if you have filters that contain slashes. Otherwise this method works really well if you happen to need to add another filter ahead of the dates (usually for performance reasons). The starting point for looking for the first date's "Equal To" will not change on you.
------------------------------------------------------------------------------------
-----Original Message-----
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]On Behalf Of Richard Bailey
Sent: Thursday, October 20, 2005 6:21 AM
To: UserGroup
Subject: [Vantage] Report Builder Filters
Does anybody know if there is a way of setting a variable in a report
builder report based on a filter value?
The REPORT-FILTER value cannot be interrogated via "substring" directly or
indirectly. Is there any other way of getting at the filter values?
All advice gratefully received
Regards,
Richard
Richard Bailey
Dudley Industries
Mailto: rbailey@...
Tel: +44(0)1253 738311
Mob: +44(0)7836 550360
Fax: +44(0)870 7628173
Useful links for the Yahoo!Groups Vantage Board are: ( Note: You must have already linked your email address to a yahoo id to enable access. )
(1) To access the Files Section of our Yahoo!Group for Report Builder and Crystal Reports and other 'goodies', please goto: http://groups.yahoo.com/group/vantage/files/.
(2) To search through old msg's goto: http://groups.yahoo.com/group/vantage/messages
(3) To view links to Vendors that provide Vantage services goto: http://groups.yahoo.com/group/vantage/links
_____
YAHOO! GROUPS LINKS
* Visit your group " vantage <http://groups.yahoo.com/group/vantage> " on the web.
* To unsubscribe from this group, send an email to:
vantage-unsubscribe@yahoogroups.com <mailto:vantage-unsubscribe@yahoogroups.com?subject=Unsubscribe>
* Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service <http://docs.yahoo.com/info/terms/> .
_____
[Non-text portions of this message have been removed]
Yes, you definitely CAN use the Report-Filter values. But you must first pass it through an aggregate function (like Min or Max) and then use the result of that. Technically it is cheating but it works.
Below are some notes from a text file I keep handy for cut/paste in reports where I need a filter date range in the header. The principle is the same for any situation where filter info is needed as well as setting bogus true/false flags for turning on/off things like detail or group bands.
Alas, this will soon be obsolete knowledge with 8.0.
-Todd C.
------------------------------------------------------------------------------------------------------------------------
PrtFilter = Report-Filter() ! (system function)
ParseFilter = Minimum(PrtFilter) ! must pass thru aggregate due to indirect use of function
! In the following adjust the starting point (60) as needed depending on the filters
! and the position of the first date test
Start-From: INDEX(ParseFilter,'equal to',60) + 9
Start-To: INDEX(ParseFilter,'equal to',Start-From) + 9 SEE NOTE BELOW!!!!!
FromDate: SUBSTRING(ParseFilter,Start-From,10)
ToDate: SUBSTRING(ParseFilter,Start-to,10)
FromDate and ToDate are the dates you can use in the heading of the report. Or if you have only one date you can skip the other.
Please note that the starting "off-set" (in this case 60) may be different for your set of filters. Also the above example assumes the end date filter is the next one following the start date filter. Report filters, as returned by the REPORT-FILTER function are phrased written out in words not using symbols (like + < >) so all comparisons end in "equal to" (such as "less than of EQUAL TO") So this makes "equal to" a good marker to search on for dates.
NOTE!!!!
As of 2/10/04 there is a BETTER WAY to determine the starting location for each date that does not "break" if you add new filters ahead of the dates. So you may either find the starting position for dates by "Equal To" locaiton or.......
Start-From: INDEX(ParseFilter,'/') - 2
Start-To: INDEX-NTH(ParseFilter,'/',3) - 2
What these do is to find the first "slash" and backup two characters to the start of the date. Then the next one finds the third "slash" using the INDEX-NTH function and does the same. If you had several date ranges just set the NTH part accordingly. The only reason this method might not work is if you have filters that contain slashes. Otherwise this method works really well if you happen to need to add another filter ahead of the dates (usually for performance reasons). The starting point for looking for the first date's "Equal To" will not change on you.
------------------------------------------------------------------------------------
-----Original Message-----
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]On Behalf Of Richard Bailey
Sent: Thursday, October 20, 2005 6:21 AM
To: UserGroup
Subject: [Vantage] Report Builder Filters
Does anybody know if there is a way of setting a variable in a report
builder report based on a filter value?
The REPORT-FILTER value cannot be interrogated via "substring" directly or
indirectly. Is there any other way of getting at the filter values?
All advice gratefully received
Regards,
Richard
Richard Bailey
Dudley Industries
Mailto: rbailey@...
Tel: +44(0)1253 738311
Mob: +44(0)7836 550360
Fax: +44(0)870 7628173
Useful links for the Yahoo!Groups Vantage Board are: ( Note: You must have already linked your email address to a yahoo id to enable access. )
(1) To access the Files Section of our Yahoo!Group for Report Builder and Crystal Reports and other 'goodies', please goto: http://groups.yahoo.com/group/vantage/files/.
(2) To search through old msg's goto: http://groups.yahoo.com/group/vantage/messages
(3) To view links to Vendors that provide Vantage services goto: http://groups.yahoo.com/group/vantage/links
_____
YAHOO! GROUPS LINKS
* Visit your group " vantage <http://groups.yahoo.com/group/vantage> " on the web.
* To unsubscribe from this group, send an email to:
vantage-unsubscribe@yahoogroups.com <mailto:vantage-unsubscribe@yahoogroups.com?subject=Unsubscribe>
* Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service <http://docs.yahoo.com/info/terms/> .
_____
[Non-text portions of this message have been removed]