2 Replies Latest reply on Oct 2, 2016 9:19 AM by William Strouse

    How do I compare Current Sales Trends to Similar Time Segments from the Previous 2 Days?

    William Strouse

      Hello Vizzers,


      My name is Will and I investigate fraud.


      My current task to to build a viz with viz alerts triggered on suspect sales volume for high risk classes.


      The volume of data is so large, and I am automating the script through Alteryx every 30 minutes, which means the max time period I have in the data at any one time is 3 days. I am tempted to put the calc in Alteryx to help the dashboard performance, but that is another issue.


      Also, our sales have a normal trend throughout the day (low late at night and peaking around 4-5pm). The trick is to compare the wee hours of the night to themselves, and not peak sales time, as the late hours in when we experience the most attacks.


      I am trying to compare the current sales volume/$ to the average performance plus and minus 30 minutes for the previous 2 days.


      Let Z= current average performance

      X= yesterday’s time segment (24 hrs +/- 30 minutes)

      Y=2days ago (48 hrs +/- 30 minutes)


      The viz alert would trigger on sdv +/- 3 of Z compared to a moving avg(X,Y)


      Where :


      curdate-1410 minutes > x < curdate – 1470 minutes


      curdate – 2830 minutes > y < curdate – 2910 minutes


      I have it figured out mathematically, but having a lot of trouble with the date functions.