I am working on a spotfire app and I am trying to create an action control that filters dates. I am new to ironpython and can't figure out what is wrong with my script:
from Spotfire.Dxp.Application.Visuals import *
import datetime as dt
visual = viz.As[VisualContent]()
visual.Data.WhereClauseExpression = '[Agreement End Date] < dt.date.today()'
When the above script is run I get "The expression is not valid after '(' on line 1 character 34. Here Agreement End Date is the column I am trying to filter on. I have looked around and haven't been able to find an answer (I realize this probably a very simple task for someone experienced in such things).
Any help is greatly appreciated!
I figured out what was going on here, you need to use spotfire functions inside of the WhereClauseExpression string. The following code fixes the issue:
from Spotfire.Dxp.Application.Visuals import *
visual = viz.As[VisualContent]()
visual.Data.WhereClauseExpression = '[Agreement End Date] < DateTimeNow()'