Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Finding the minimum date value.
BAIG
Hello,
I have a Dataset with the following columns
ProgramRelease, MemberName, ProjectEngineer, Date_Groupmeeting1, Date_Gropmeeting2,, Date_Groupmeeting3.
When I display the above I need to display the minimum of the Date_Groupmeeting1, Date_Gropmeeting2,, Date_Groupmeeting3.
The expected output will look somewhat as below.
ProgramRelease MemberName Projectengineer Latest Meeting Date
Proj1_Rel1 xxxxxx yyyyy 01/01/2010
Proj2_Rel2 bbbbbb ccccc 02/01/2010
Please let me know how to perform the minimum date function.
Thanks.
Find more posts tagged with
Comments
mwilliams
Hi BAIG,
One way to do it would probably be to create a computed column and use the dateTimeSpan functions to compare each of the 3 dates to todays date and select the appropriate date based on your findings. Then you can just use this computed column as the 4th column in your report. Let me know if you have questions.
johnw
Couldn't you just do something like:
var lowest = null;
if (d1 < d2)
{
lowest = d1;
}
else
{
lowest = d2;
}
if (d3 < lowest)
{
lowest = d3;
}
return d3;
If not, the Date object has the compareTo method, so you can use that instead of the less than operator.
Otherwise, if this is going to be re-usable, you could write an aggregation extension for this, or a script library extension, and use it as a function.