0

Sum of values of a field of a specific date

I'm looking (and can't find) a solution to calculate the grand total of a field of a given date...

No problem illustrating this with a view, but that's no use to me since I need it as a value in a formula field

thanks!

8 replies

null
    • Fred
    • 10 mths ago
    • Reported - view

    How will you be selecting the date to filter the results by?

    • Astavakra
    • 10 mths ago
    • Reported - view

    With date I mean days … sorry 

    • Fred
    • 10 mths ago
    • Reported - view

    What is your view formula, what is the name of the field you want to filter with and what value do you want to filter on?

    • Astavakra
    • 10 mths ago
    • Reported - view

    There is no view … the field is called blue and I want the sum in a Formular field filtered by day … so how much blue‘s is there today

    thx

    • Fred
    • 10 mths ago
    • Reported - view

    You can try something like:

    let x := select TableName where datefield = today();
    sum(x.blue)
    

    Just replace the TableName with the appropriate table name and datefield with the appropriate date field name.

    If you have related records then it would look something like this if you are in the 1 side of a one to many (1:N) relationship:

    sum(relatedfieldname[datefield = today()].blue)
    
    • Astavakra
    • 10 mths ago
    • Reported - view

    Hm, it’s not so much about today … this would work, thx 

    it’s about all the entries of a similar date - fe all for June 21st 2023 - need it mainly to plan things by days … so doesn’t work with today(), but what to replace that?

     

    thx

    • Fred
    • 10 mths ago
    • Reported - view
    Astavakra said:
    it’s about all the entries of a similar date - fe all for June 21st 2023 - need it mainly to plan things by days … so doesn’t work with today(), but what to replace that

    Are you going to hard code the dates in the code? If you are then you can do something like:

    let xDate := date(YYYY,MM,DD);
    let x := select TableName where datefield = xDate;
    sum(x.blue)
    

    Are you going to have a date field in a form that you will pull the date from?

    let t := this;
    let x := select TableName where datefield = t.otherdatefield;
    sum(x.blue)
    
      • Astavakra
      • 10 mths ago
      • Reported - view

      Fred thank you, that’s it!

Content aside

  • Status Answered
  • 10 mths agoLast active
  • 8Replies
  • 108Views
  • 2 Following