12 Replies Latest reply: Sep 30, 2014 7:56 AM by Ashfaq Mohammed

# Sum of Costs in current week in Textbox

Hello everyone

I would like to show the sum of my Field "costs" in a textbox. But only of the current week. What is the expression for this?

Thank you very much in advance...

• ###### Re: Sum of Costs in current week in Textbox

=Sum({<Week={"\$(ThisWeekVariable)"} >} costs)

Assuming that you have a variable holding this week

or you may replace the variable with an expression for this week :

=Sum({<Week={"\$(=week(today()))"} >} costs)

• ###### Re: Sum of Costs in current week in Textbox

Ευχαριστώ

But then I get all values from week 40, also in the years before, right?

Best

Jan

• ###### Re: Sum of Costs in current week in Textbox

true so add year in the set expression as well

=Sum({<Week={"\$(=week(today()))"}, Year={"\$(=Year(today()))"}>} costs)

• ###### Re: Sum of Costs in current week in Textbox

Okay, the value in the textbox is still the total sum of all values. The whole expression is underlined with a red line. something does not fit with the expression yet...

• ###### Re: Sum of Costs in current week in Textbox

Try like this

=Sum({<Week={"\$(=week(today()))"},Year={"\$(=Year(today()))"} >} costs)

Replace fields with your actual fields

Regards

ASHFAQ

• ###### Re: Sum of Costs in current week in Textbox

AWESOME! Thank you very much!

• ###### Re: Sum of Costs in current week in Textbox

Hi,

Regards

ASHFAQ

• ###### Re: Sum of Costs in current week in Textbox

isn't that the same as mine?

=Sum({<Week={"\$(=week(today()))"}, Year={"\$(=Year(today()))"}>} costs)

• ###### Re: Sum of Costs in current week in Textbox

Yup, sorry.

• ###### Re: Sum of Costs in current week in Textbox

np, I was just wondering

• ###### Re: Sum of Costs in current week in Textbox

Hi,

Try something like this

=sum( {\$<Week = Week(today()) >} Costs )

• ###### Re: Sum of Costs in current week in Textbox

Try this

Sum({\$<DATE={"<=\$(=Date(Max(DATEWeek)-7,'DD-MM-YYYY'))"}>}costs)

Make sure Date format is same as used for Date field.