Jump to content

How to filter visualization using a date range from user input using property control


Jason Elkin

Recommended Posts

I'm attempting to limit the data displayed by a visualization by comparing a date range set by the user with a property control. The date range is compared to the dttmspud column and is supposed to show "True" if the date is within the input range, and "False" if the datedoes not fall within the date range. The visualization would then be limited to only the data with a "True" result using the "limit data using expression"in column properties.

I created two property controls that allow the user to pick a date which are identified by the "BeginDate" and "EndDate". The available dates are unique values from the dttmspud column which are the dates being compared to the date range chosen by the user. These dates are queried and are input in another program.

An example value for the BeginDate and EndDate can be seen in the attached image in available properties for column. I've tried using the Date and DateTime function to make sure formatting is correct but doesn't help.Depending on the operator used, I get either all False or all True results.

Link to comment
Share on other sites

Not sure why, butadding quotes to the property control dates being compared to the dttmspud date appears to fix the issue. The If statement looks as follows, if thequotations are removed it does not read the dates correctly

If([DateTime([dttmspud]])] >= DateTime("${BeginDate}")

And[DateTime([dttmspud]])]

Link to comment
Share on other sites

When the document property type is not Integer/Real, you need to put it in the quotes when you are inserting it as a text. Instead, you can also insert it as value like: DocumentProperty("BeginDate")

Apart from that, you can also avoid using the IF() loop because the expression itself is a boolean.

([DateTime([dttmspud]])] >= DateTime("${BeginDate}") And [DateTime([dttmspud]])]

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...