Hi ,
I have two date start date and end date , and i want time duration in days but the problem is data is coming from task report .
a!gridTextColumn( label:"Start Date", field:"c6", data:index(local!dataset.data,"c3",{}) ),
and
a!gridTextColumn( label:"End Date", field:"c8", data:index(local!dataset.data,"c11",{})
),
i need one more column which shows the duration of time for these two date .
please suggest
Discussion posts and replies are publicly visible
You would be able to handle this case in the logic of your a!forEach() expression once you get the math working for non-null cases. Just wrap the expression in an if() statement where you check i.e. "isnull(fv!item.c3)" and return a different value in that case.
Hi Peter i understand that but I'm getting the result
0::00:00:11.207
which i don't need that i need this result only in days . because some task assigned in same date and completed in same date so for that scenario it should be 0 .... i hope you are getting my point
I suggest you write an expression rule called something like "APP_getElapsedDaysBetweenDates" that accepts two DATETIME parameters and returns a result that matches what you are after - i.e. whole numbers (0, 1, etc) for business days, or decimals to represent days and partial days, and also handles null-checking on either or both of the inputs. After that, you can simply call that rule and pass in the two columns from your report within the logic of your a!forEach statement. Doing it this way will make it much more easy to initially test that the math you're trying to do is both working without error, and returning the exact return value you're expecting.
Agreed with Mike - troubleshooting is much easier one at a time. Also, since you're looking for just the days, I'd suggest putting floor() around your interval result, which should give you the number of days in an integer.
Thanks Peter , I got my solution