How to get sum of specific values of an entity in another entity?

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • Maximus
    commented on 's reply
    Hi,
    Is it related to this https://forum.espocrm.com/forum/gene...atetime-fields ?

  • hristos
    replied
    How to update result field (the number of hours of two datetime fields) based on 'startwork', 'stopwork'. Both fields are datetime

    Leave a comment:


  • Maximus
    replied
    Hi sandra6012
    Could you explicit it? Does it mean that you are trying to sum 'pagoTotalARealizarConverted' by using a filter like 'Pago Atrasado'? Right? If so, there is no such filter in the system. You need to add it to be able to use it. Please investigate this post https://forum.espocrm.com/forum/deve...6640#post56640.

    Leave a comment:


  • sandra6012
    replied
    You are not applying the filter, you are adding all the related records.

    saldodos=entity\sumRelated('estadoDeCuentaYPagos', 'pagoTotalARealizarConverted',
    'Pago Atrasado');

    Help!

    Leave a comment:


  • Maximus
    replied
    Do you have a relationship between the result and student as One-to-Many? If so, and you are using a Report feature, I think that you don't need to use Formula.

    Leave a comment:


  • sujithraalink
    replied
    I have applied this..created a report and reportfilter and reportfilterid has applied ..but didn't work..

    Leave a comment:


  • Maximus
    replied
    Hello,
    try this https://github.com/espocrm/documenta...titysumrelated.

    Leave a comment:


  • How to get sum of specific values of an entity in another entity?

    I have two entities result and student. In result entity i have 2 fields "score"(Integer) and "resultStatus"(Enum). resultStatus has 2 values "Passed" and "Failed".
    I want to get the sum of "Passed" values in student entity.
    I have applied the formula below and it works fine but fetches the sum of all the passed/failed status. How can i get the sum of "passed" status. (that is sum of columns when resultStatus="Passed").
    this is the formula i have applied . totalScoreAchieved=entity\sumRelated('results', 'score','student'); Please help me to resolve the issue .
Working...