Using variables in Pivot Reports' filter

Using variables in Pivot Reports' filter

Hello,

Is there any way that I can use a variable, instead of a value or range or top/bottom %, when adding a filter to the report. 

Example: I would like to pass a variable from a script that calls a chart/table.  The value in that variable will be used to filter the records to be displayed or charted.

Any help would be appreciated

Thank you