2 Replies Latest reply on Apr 18, 2017 10:24 PM by Galen Busch

# Change parameter selection based of quick filter

Hello,

I have a situation where based on a Relative date filter selection I have to change value of a parameter.

Relative Date quick filter has these values:

last 7 days

Last 30 days

Month To Date

Quarter to date

Year to date

Parameter value should be:

Last 7 days=> Daily

Last 30 Days=> Daily, Weekly

Month To Date=> Daily, Weekly

Quarter to Date=> Weekly, Monthly

Year to date=> Monthly, Quaterly

The parameter is used to define the granularity of the tabular view in the dashboard.

Suppose, Last 30 days is selected on the Relative Date filter then user should have the ability to see data, daily or weekly.

Thanks

Rashi

• ###### 1. Re: Change parameter selection based of quick filter

Hi Rashi,

Parameters are typically used to get user inputs that must update the viz.

I think the solution I can think of is to create a calculated field that is based on the logic you have mentioned for the parameter fiel. And then use the calculated field instead to define the granularity of the viz? Is that a workable solution?

Thanks!

1 of 1 people found this helpful
• ###### 2. Re: Change parameter selection based of quick filter

Hi Jinesh,

Without having a workbook to play with, here's how I might approach this problem.

I would test how many days are displayed in your filter:

COUNTD([Date]) will give you the number of days in your view

[Testing Date]

IF COUNTD([Date]) <= 7 then 1

ELSEIF COUNTD([Date]) <= 30 then 2

ELSEIF COUNTD([Date]) <= 90 then 3

ELSE 4

END

You can't 'filter' a parameter, unfortunately.

I would then create calculations for Daily/Weekly/Monthly/Quarterly:

[Daily]

If [Testing Date] = 1

OR [Testing Date] = 2

OR [Testing Date] = 3

then DATEPART('day',[Date])END

[Week]

If [Testing Date] = 2 then DATEPART('week',[Date])

OR [Testing Date] = 3 then DATEPART('week',[Date])

OR [Testing Date] = 4 then DATEPART('week',[Date])

END

[Month]

If [Testing Date] = 3

OR [Testing Date] = 4

then DATEPART('Month',[Date])

END

[Quarter]

If [Testing Date] = 4 then DATEPART('quarter',[Date])

END

If you then place these 4 discrete date calculations on your view on columns, and play with your relative date filter, you should see your date fields alter depending on the number of days in your filter.

Galen