Trying to build what should be a very simple function as a part of a workflow. Basically all I need to do is take a date field from a project and check if it's in the current year.
My original thought was I could write something like:
RIGHT(Convert(ToString('project.thisProject.schedule_start')),4) == dateMacro("currentYear")
The idea being that I could take the schedule start date attribute (say 1/1/18), then convert it to a string (presuming it would get rendered at 01012018. Then take the 4 rightmost characters = 2018. Then compare that to the currentYear using the dateMacro.
Obviously this doesn't work, but I can't seem to find any sort of functions or documentation relating to functions for expressions.
This should be easily accomplished without having to write a gel script. Any help?
Can't you just do;
PowerFilter - dateMacro
Thanks for the suggestion. Worth testing since I can't speculate how CA PPM will react when comparing a year to a date, since I assume the "currentYear" will ultimately get parsed as a date (likely 1/1/18, for example), which may be an issue.
You are looking at the date as the user local processes it. I should be inclined to think that when the comparison is made the dates are looked the way they are in the database eg 20180101T00:00:00 in MS SQL. That would give belief in comparing current year to a date.
^ yeah exactly ; surely "dateMacro" is returning a date not a string (otherwise how would it ever work with "today")
(hint:it works for me!)
Agree, we do not have very detailed documentation for the Power Filter functions. You can refer to the Build a Power Filter section in the following topic to get a generic understanding of the feature and read about some simple examples:
Personalize CA PPM - CA PPM - 15.3 - CA Technologies Documentation
Personalize CA PPM - CA PPM SaaS - 15.3 - CA Technologies Documentation
Hope this helps a little.