2 Replies Latest reply: Jul 17, 2014 1:42 AM by vishal waghole

# Set Analysis Problem.

Hi There,

I really want to write this formula but not sure how...

I want all the entries for the current month

This works:

Sum({\$<KeyDate = {">=\$(=Only(AsAtMTD))<=\$(=Only(AsAtMonthEnd))"}>} BudgetNonAccommodationCleaningDailyHours)

But instead of AsAtMonthEnd I want this value which is the latest timesheet entry which is the result of the next expression.

Max({\$<KeyDate = {">=\$(=Only(AsAtMTD))<=\$(=Only(AsAtMonthEnd))"}, TimesheetHoursWorked={">0"}>} KeyDate)

How could I write the expression to achieve this?

e.g. Which doesn't work.

Sum({\$<KeyDate = {">=\$(=Only(AsAtMTD))"}, KeyDate = P({Max({\$<KeyDate = {">=\$(=Only(AsAtMTD))<=\$(=Only(AsAtMonthEnd))"}, TimesheetHoursWorked={">0"}>} KeyDate)>} )>} BudgetNonAccommodationCleaningDailyHours)

Luke

• ###### Re: Set Analysis Problem.

Hi,

Store the value of this expression in a variable

vLatestTimesheetEntry = Max({\$<KeyDate = {">=\$(=Only(AsAtMTD))<=\$(=Only(AsAtMonthEnd))"}, TimesheetHoursWorked={">0"}>} KeyDate)

and then use this expression in set analysis

Sum({\$<KeyDate = {">=\$(=Only(AsAtMTD))<=\$(vLatestTimesheetEntry))"}>}

• ###### Re: Set Analysis Problem.

Hi Like,

Sum({<KeyDate={">=\$(=Num(MonthStart(Max(KeyDate))))<=\$(=Max(KeyDate))"}, TimesheetHoursWorked={">0"} >} BudgetNonAccommodationCleaningDailyHours)

Hope this expression work for you.

-- Regards,

Vishal Waghole