All,
Is there a way to Hierarchy select with a variable date?
Static dates work fine, but I cannot figure out how to put a variable date in a hierarchy select
I tried a variety of expressions & variables without luck, such as:
- Today()
- @expressioniToday()]
- @expressioniNow()]
- another dttm column (such as task.plan_end_dttm)
This works as intended, with a static date value:
<hierarchy_select>
<attrs>
<attr>task.task_id</attr>
</attrs>
<primary_table>task</primary_table>
<from>
<table>task</table>
</from>
<where>
<data_constraint>
<constraint>
<left_operand>task.plan_start_dttm</left_operand>
<operator>gt</operator>
<right_operand>4/26/2024</right_operand>
</constraint>
</data_constraint>
</where>
</hierarchy_select>
This is what I’m trying to accomplish, which I cannot get to work
Sample 1 (variable)
<hierarchy_select>
<attrs>
<attr>task.task_id</attr>
</attrs>
<primary_table>task</primary_table>
<from>
<table>task</table>
</from>
<where>
<data_constraint>
<constraint>
<left_operand>task.plan_start_dttm</left_operand>
<operator>gt</operator>
<right_operand>@expressionrToday()]</right_operand>
</constraint>
</data_constraint>
</where>
</hierarchy_select>
sample 2 (from dttm field)
<hierarchy_select>
<attrs>
<attr>task.task_id</attr>
</attrs>
<primary_table>task</primary_table>
<from>
<table>task</table>
</from>
<where>
<data_constraint>
<constraint>
<left_operand>task.plan_start_dttm</left_operand>
<operator>gt</operator>
<right_operand>task.plan_end_dttm</right_operand>
</constraint>
</data_constraint>
</where>
</hierarchy_select>
The error returned is:
<metrix_response>
<result type="Exception">
<error>
<system_error>
<severity>ERROR</severity>
<message>The following system level exception was generated by the application: String was not recognized as a valid DateTime.
Contact your system administrator for assistance. The server log or event log may contain more details about the error.</message>
</system_error>
</error>
</result>
</metrix_response>
Appreciate any feedback