Announcement

Collapse
No announcement yet.

Report: calculation error per week

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Report: calculation error per week

    Hello,

    When using reports with a date count, there are calculation errors. If we count by weeks, some items are not counted whereas if we count by days, all items are counted.
    It is very difficult to explain in detail or to reproduce the bug on the demo, but there is really a problem.

    If you want to see a screencast in private, I can create one to help you.

    Good courage

  • #2
    Hi,

    Reproduced. This could be related to how the first week is determined for the beginning of the year. I will take a look.
    Last edited by yuri; 01-30-2018, 06:39 PM.

    Comment


    • #3
      Hello,

      This problem still exists. To show you precisely the problem, I reproduced it on the demo. Unfortunately, the demo was reset... so I was forced to do it again. It's done!

      I created a Package entity and a Shipping entity:
      - Shipping contains a Date and Time field.
      - Each Package is linked to a Shipping entity.

      I have created a weekly statistical report based on the Packages, the configuration of which is attached.

      The week numbers do not correspond to the real weeks: there is a one-week delay.

      Do you see the problem, please?

      Thank you.

      Comment


      • #4
        MySQL function WEEK https://dev.mysql.com/doc/refman/5.5...#function_week in MODE 5 is used.

        I tried to reproduce the same on another server and it grouped properly. 11 Nov 17:00 in #45, 12 Nov 17:30 in #46.

        So it could be a problem with mysql function in some environments.
        Last edited by yuri; 11-27-2018, 06:30 PM.

        Comment


        • #5
          I could reproduce it on another server. I will try to fix.

          Comment


          • PGI
            PGI commented
            Editing a comment
            Ok, thank you very much! Sorry for the following message I posted at the same time as your answer.

        • #6
          Hello,
          Thank you for that answer. So the problem is deeper... I guess it will be difficult to solve it! However, this is really a problem since all my weekly reports are wrong.
          Do you think it is possible to find a solution?
          Thank you for your help.
          See you soon

          Comment


          • #7
            Will be fixed in the next release. I believe at the end of this week. The problem that for related columns the first day of the week was considered Sunday.

            Comment


            • #8
              Hello,

              I was having the same reporting problem when running the Week function to count the weeks.

              I was able to fix it by changing the code Base.PHP inside the directory /html/application/Espo/ORM/DB/Query/

              Within the getFunctionPart function I changed the parameter passed inside the switch from 0 to 1.

              case 'WEEK_0':
              return "CONCAT(YEAR({$part}), '/', WEEK({$part}, 1))";


              line 333.

              Comment

              Working...
              X