Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
sridhar_sigired
Creator
Creator

Selection of days or weeks based on input value

Hi,

I have a Date dimension table with all fields. I want to show input box and if user enters any number, then previous days / previous weeks should be selected accordingly. Can we achieve this? For example,

I provide a input box and a list box with two fields (previous days, previous weeks (from today to back))...

If user enter 20 in input box and select previous days field from list box then my dates should be selected from 06/02/2016 to 06/21/2016.

Can you please anyone suggest how can we achieve this?

Thanks,

Sridhar

1 Solution

Accepted Solutions
sushil353
Master II
Master II

Yes you can select in the date table: as you have two variable then follow the below steps

go to Settings – Document Properties – Triggers

Variable Event Triggers

Select vStartDate

OnChange Add Action

Add

Select in Field

Field = Your Date Field

Search String = ='>='&vStartDate & '<=' & vEndDate

HTH

Sushil

View solution in original post

4 Replies
sushil353
Master II
Master II

Check the attached file.

HTH

Anonymous
Not applicable

Hi Sridhar,

Use a variable to calculate max date and a variable to calculate min date:

vMinDate -> IF(PrevField = 'Days',Max(Date)-If(IsNull(vInputBox),0,vInputBox),

                         Max(Date) -If(IsNull(vInputBox),0,vInputBox*7))

vMaxDate -> =Max(Date)

Regards!!

sridhar_sigired
Creator
Creator
Author

Hi,

Thanks for your time, when i enter 20, i need to select all dates from today to previous 20 days.

Can we achieve this?

sushil353
Master II
Master II

Yes you can select in the date table: as you have two variable then follow the below steps

go to Settings – Document Properties – Triggers

Variable Event Triggers

Select vStartDate

OnChange Add Action

Add

Select in Field

Field = Your Date Field

Search String = ='>='&vStartDate & '<=' & vEndDate

HTH

Sushil