• Recent
    • Tags
    • Popular
    • Register
    • Login

    Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

    Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website Mango 5 Documentation Website

    "Business week" weekly rollup question for watchlists of and excel reports

    User help
    2
    5
    597
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • TurboT
      Turbo
      last edited by

      Greetings, all:

      I'm trying to get rollups to play better with weekly reports.

      I've got a bunch of metapoints that run on times to calculate various things. These are all working fine.

      However, I don't know how to get these to reliably output as "business week" style things in the report.

      By "Business Week" I mean Last 7 days from Sunday night (So, say, Monday -> Sunday as a "business week"). We're outputting data that is compared to something else, and they use Business Week as Data. Mango's "week" is apparently DAY OF YEAR Modulus 7, which is fine, but provides difficulty for "business week" output.

      Here's my report setup:
      TIME PERIOD: Previous 7 days
      Rollup Type: SUM of 7 DAYS
      Configured Data:
      Data calculated hourly

      With that, when I run the report, I'm expecting the Time Stamp to be the START of the period or the END of the period. For example, when we do a "Previous 1 month" the timestamp stored in the excel spreadsheet is the 1st of the previous month.

      However, with the time period / rollups I described above ,the timestamp stored in the excel spreadsheet tends to be like, the Friday in the middle of the period? I'm confused by this, and so are the customers.

      So: Guess my questions are:
      (1) How does Mango chose the timestamp when using Previous 7 Days time period and 7 day sum rollup, and
      (2) Is there something I'm missing about how to get Mango to understand the concept of "business week" (Monday->Sunday) rather than modulus week (Day of Year % 7)?

      This throws off our calculations a bit, since if you use a SUM on a month in the Watchlist viewer, you get fine data, and it all jives. But if you do SUM over a week, it looks odd, and insists on plotting values on Fridays rather than any other day. This presents a problem for us, since the data we're comparing to is done on Business Week (Monday -> Sunday) type basis.

      Cheers,
      -Greg

      1 Reply Last reply Reply Quote 0
      • MattFoxM
        MattFox
        last edited by MattFox

        (1) How does Mango chose the timestamp when using Previous 7 Days time period and 7 day sum rollup, and

        (2) Is there something I'm missing about how to get Mango to understand the concept of "business week" (Monday->Sunday) rather than modulus week (Day of Year % 7)?

        1. From what I've seen, they automatically use the base timestamp at the time of request and move around that point as an anchor. Same for watchlists, unless previously assigned, the date-time calendar will be set to the time on browser load.
        2. If you want a "Business week" you're gonna have to define it.

        Can you not use a Cron timer to "enforce" the time to schedule and fire the report? I'd do it at 12AM Monday. That would then work from Monday 12AM prior to Sunday 23:59:59. At least that's how I can see it working....
        Perhaps that will provide the "Business week" format you are after.
        EDIT:
        mango's system claims:

        Similarly, "Month(s)" starts the time span at midnight on the first day of the previous month and ends it on the last day of the previous month (when the number of periods is 1). Other period types work the same. A week starts on Monday at midnight in accordance with ISO standards
        

        But given the issues you are having it does raise some eyebrows...
        Trying to do it on the fly IMO will involve probably some slightly more involved datasource scripting....

        Do not follow where the path may lead; go instead where there is no path.
        And leave a trail - Muriel Strode

        1 Reply Last reply Reply Quote 0
        • TurboT
          Turbo
          last edited by

          Thanks for the prompt response here- Something odd must be happening.

          I've just been poking around again and here's what I've found:
          (1) When in Watchlist, with a 1 week sum rollup type plotted over the "last 1 month" default setting, with a Line chart type, the data points displayed update on the Fridays (in this case, 4/23, 4/30, 5/7, 5/14, and 5/21) at midnight.

          (2) When I run a report with the same settings, as seen below,
          583d6a05-bc4b-4d40-91b4-a318c6263540-image.png

          Mango says the same thing: I get the following timestamps out of Mango:
          bf05fe3f-909a-47d7-a4e8-96771232b75f-image.png
          44309.00
          44316.00
          44323.00
          44330.00
          44337.00

          Which, when converted to Date in Excel, are the same dates
          919e46cd-6fd5-4aab-b2b8-a06dee0ced7f-image.png 04/23/21
          04/30/21
          05/07/21
          05/14/21
          05/21/21

          As when we use the rollup as described before.

          I'm also getting "previous month" data in the same way (1 month rollup sum), and that data outputs just fine: It timestamps as the START of the month, 4/1, and merrily outputs the proper sum for the month.

          That's why I was investigating what Mango understands as a "week".

          I just tried this on another Mango instance we run- And it did the same thing. Using the "week" rollup has end times starting on the FRIDAY of the week at Midnight.

          Our systems are set to MDT time; I've gathered that it may make a difference for Java's internal time handling if we use the City-based time, rather than MST/MDT/etc (since midnight moves around).

          Just now, to try this out, I set up the same report on out first machine to do "last 7 days", with the following settings:
          baa08d62-6d47-46a4-bd06-342d7e3d084c-image.png

          With those settings, I would expect Previous 28 days and sum of 7 days, I would expect this to give me dates of Today (at midnight) or 7 days ago (at midnight). From right now (17:22 MST 5/26/21) that would give me 26, 19, 11, etc as the dates. Instead, I get this:
          a896706d-e44e-4180-a63b-10d1e59f07a1-image.png

          44309
          44316
          44323
          44330
          44337

          Which excel turns into this
          7c0c6705-70c4-4406-9d43-c8cc312fdcfd-image.png 4/23/2021
          4/30/2021
          5/7/2021
          5/14/2021
          5/21/2021
          Which is the same as when I used the "previous week" rollup type.

          Anyways; The date shown by this instance is "Wed May 26, 2021, MDT"
          22f43ee5-46ce-46ac-9e8e-617e738a58cd-image.png
          Which means the clock isn't off by a few days, which would explain this.

          Any thoughts on this?

          1 Reply Last reply Reply Quote 0
          • MattFoxM
            MattFox
            last edited by

            Looks buggy to me, or undesired behaviour at least. Have you tried forcing it to do it with a fixed timeframe as opposed to a relative?
            If that works, perhaps we can leverage aascript or at least something with the api using dashboard components..

            Fox

            Do not follow where the path may lead; go instead where there is no path.
            And leave a trail - Muriel Strode

            1 Reply Last reply Reply Quote 0
            • TurboT
              Turbo
              last edited by

              Greetings, all:

              Here's a new one for you.

              I did an apt-get upgrade on our server and then restart Mango, and.. Now I'm getting dates that seem to make sense. I need to run this again tomorrow when I"m not so tired, but I think updating the server and rebooting mango.. Fixed this?

              This is odd and slightly disconcerting, but yay for how software sometimes behaves.

              I'll run some more reports, but I think resetting mango and apt-get updating our Linux install fixed this (for now anyways).

              Thanks for your help..

              Cheers,
              -Greg

              1 Reply Last reply Reply Quote 0
              • First post
                Last post