Forum Discussion

ERussell's avatar
ERussell
Frequent Visitor
6 years ago
Solved

Ghost query causing report refresh to fail in service

I recently published a report up to the service that has been working, but now in the service when I try to refresh I see an error message that says:   "You can't schedule refresh for this dataset ...
  • ERussell's avatar
    ERussell
    6 years ago

    I figured out what was causing the problem.  This step in one of my queries:

     

     #"Run Python script" = Python.Execute("
    
    def f(flag):
        global previous_seq
        previous_seq = 0 if flag == 0 else previous_seq + 1
        return previous_seq
    
    previous_seq = 0
    dataset['Fiscal Period'] = dataset[['PERIODCODE']].apply(lambda x: f(*x), axis=1)
    
    ",[dataset=#"Changed Type"]),
     

     

    What it was doing was numbering the fiscal periods 1-# based on the opening and closing period codes. This allowed me to handle years with <> 12 fiscal periods, but going through the history there was only one year that had 13 periods. So instead, I just filtered the years past that year, created an index column starting with 1, then used Number.Mod([Index], 12) and replaced the 0's with 12. Stuck with only being able to hand years with 12 periods, but at least the refresh is working from the service again.  What I don't get is why the query previously worked in the service (albeit through a personal gateway rather than my enterprise), and suddenly stopped when that query hasn't been changed since I first wrote it. Ah well, such is life 🙂 Thanks for your help!