Help with parameter creation

How can we create a parameter named time range for last 7 days last 10 days last N days by default to today .

As in how can we use this parameter as a filetr

ifelse(

${TimeRange} = ‘Today’ AND

{tran_local_date} = now(),

${TimeRange} = ‘Last 7 days’ AND

dateDiff(now(),{tran_local_date}) <=7,

${TimeRange} = ‘Last 30 Days’ AND

dateDiff(now(),{tran_local_date}) <=30,

${TimeRange} = ‘Last 90 Days’ AND

dateDiff(now(),{tran_local_date}) <=90,

${TimeRange} = ‘Last 180 Days’ AND

dateDiff(now(),{tran_local_date}) <=180,

${TimeRange} = ‘Last 365 Days’ AND

dateDiff(now(),{tran_local_date}) <=365,

,NULL

)

Hi @deepa.singh

the creation part should look like

your caltulation is missing the else part e.g.

ifelse(
${TimeRange} = ‘Today’ AND
{tran_local_date} = now(),**1**

When the parameter is “today” and your data is now() then the field is getting a 1.
That way you can then filter the field on value 1.

BR

Thanks Erik

When the parameter is “today” and your data is now() then i want to filter that data with todays value

@ErikG
ifelse(
{tran_local_date} = now(),${TimeRange} = ‘Today’ ,

dateDiff(now(),{tran_local_date}) <=7,${TimeRange} = ‘Last 7 days’,

dateDiff(now(),{tran_local_date}) <=30,${TimeRange} = ‘Last 30 Days’,

dateDiff(now(),{tran_local_date}) <=90,${TimeRange} = ‘Last 90 Days’ ,

dateDiff(now(),{tran_local_date}) <=180,${TimeRange} = ‘Last 180 Days’,

dateDiff(now(),{tran_local_date}) <=365,${TimeRange} = ‘Last 365 Days’

,NULL

)

@ErikG

Please respond

Please have a look:

LastNDays

Thanks you erik for solving this for me