5 Replies Latest reply on Aug 4, 2016 6:16 PM by khaner

    Not able to 'Preview' analysis results for table lookup

    Asle Frantzen

      Hi

       

      I have an AFTable where I do table lookups into my attribute 'Sum_Abonnemang', configured like this:

      SELECT Sum(Abonnemang) FROM [AboTabell] WHERE Station = '%Element%' AND [Start time] <= #%Time%# AND [End time] > #%Time%#

       

      Aditionally I have an expression analysis time scheduled at midnight, and configured like:

       

      MyTime: ParseTime("t")

      Output: TagVal('Sum_Abonnemang',MyTime)

       

      If I evaluate this I get the current value of the 'Sum_Abonnemang' tag, but I don't get any results if I 'preview' the results. But it works if I manually change the MyTime variable to ParseTime("t-1d") or "t-5d". What am I doing wrong?

       

      I'm on the latest and greatest version-wise here.

        • Re: Not able to 'Preview' analysis results for table lookup
          dsouzarich

          Have you tried restarting the Analysis Service, though the more rigorous way is to stop the Analysis service, restart AF, start the Analysis service. I would be interested in knowing if this works for you, is works for us on AF version 2.6, we do this whenever we see this type of issue.

          • Re: Not able to 'Preview' analysis results for table lookup
            dsouzarich

            BTW - you can just set MyTime to 't'  , no need to use ParseTime

             

            I have a post on time periods, has a few examples of period calculations.

            • Re: Not able to 'Preview' analysis results for table lookup
              Asle Frantzen

              Unfortunately that had no effect... Which was expected really, since the Preview and Backfill functions are separate from the actual analysis service.

               

              I think I'll just have to contact techsupport to get some extra eyes on this.

                • Re: Not able to 'Preview' analysis results for table lookup
                  dsouzarich

                  Could you update this post when you get something back from techsupport.

                   

                  We have seen these issues on 2.6, and it varies between me and another user. We have found that the restart of the AF service itself works for us. I have to wonder if it is a caching thing. We do make a large number of daily changes on our development server, we don't see the same issue on production, though there was an issue with notifications, and again a restart of the services got things working again.

                • Re: Not able to 'Preview' analysis results for table lookup
                  khaner

                  Hi Richard D’Souza,

                   

                  I have attached an export from the tech support case that was created:

                   

                  First my table:

                   

                  Second, my table lookup DR config. The key take away here is that I changed the behavior here to reflect that the table is providing the timestamps.

                   

                   

                  I then configured my analysis. This can be configured as event-triggered since the table is providing the time stamp.

                   

                  Here are the backfill results.

                   

                  The query parameters are all handled by the analysis service (either event triggered or periodic).

                   

                  Another method would be to output the timestamp to a None DR from the analysis that you have configured and use that in your TL DR instead of the %time% substitution.  This is because the %time% substitution parameter is only evaluated once at the beginning of the backfill.

                   

                  If you do not expect the Start Time parameter of your Event Frame to be in the future, you should be able to apply the original solution. Then you can backfill the Table Lookup to a PI Point DR attribute using event-triggered or periodic scheduling.