This discussion is archived
12 Replies Latest reply: Nov 21, 2012 11:32 PM by sayak RSS

Auto Refresh an Analysis in Dashboard

649804 Newbie
Currently Being Moderated
Hi all,

I'm using OBIEE 11.1.1.6.0. I have an analysis shown in my dashboard (I'm not showing the Refresh link for this analysis in the dashboard). The database is automatically loaded every 5 minutes and BI Server cache is disabled. Therefore, I need to automatically refresh the analysis (not the dashboard) every 5 minutes, so that the analysis can show the latest data.

How can I call the Refresh link of the analysis (even though I'm not showing it in the dashboard) every 5 minutes? Is it possible to create a JavaScript that call that Refresh link every 5 minutes? Or is there other solution to achieve this requirement?

Thanks a lot!
  • 1. Re: Auto Refresh an Analysis in Dashboard
    sayak Explorer
    Currently Being Moderated
    Hi ,

    here's the script :

    <script type="text/JavaScript">
    <!--
         setTimeout("location.reload(true);",5000);

    // -->
    </script>

    Thanks
  • 2. Re: Auto Refresh an Analysis in Dashboard
    649804 Newbie
    Currently Being Moderated
    Hi sayak, thanks for your reply. However, your solution won't work in my case, because your script will refresh the whole page (dashboard).

    What I need is to only refresh an analysis on the dashboard. Cause there will be other analysis and dashboard prompts in that dashboard which I don't want to get refreshed every 5 minutes.

    Does anyone have other suggestions for this? Thanks a lot!
  • 3. Re: Auto Refresh an Analysis in Dashboard
    Srini VEERAVALLI Guru
    Currently Being Moderated
    I dont think you can do that refreshing only one analysis.

    Try to put the below code in Narrative view and add it to the analysis.
    setTimeout("location.reload(true);",5000);


    Let me/us know updates.

    Edited by: Veeravalli on Nov 21, 2012 5:43 AM
  • 4. Re: Auto Refresh an Analysis in Dashboard
    649804 Newbie
    Currently Being Moderated
    Hi Veeravalli, based on you suggestion, when the 5 minutes is up, the browser (I'm using Firefox) will pop up a notification window saying: "To display this page, Firefox must send information that will repeat any action (such as a search or order confirmation) that was performed earlier." with "Resend" and "Cancel" button available. If I click Resend, it will refresh the whole dashboard. If I click Cancel, the dashboard will never be refreshed when the next 5 minutes is up (until I navigate away to other dashboard and return to this dashboard).

    Any other suggestion, anyone? Thanks so much!
  • 5. Re: Auto Refresh an Analysis in Dashboard
    Srini VEERAVALLI Guru
    Currently Being Moderated
    The below code is based on the refresh icon on results tab in Answers.

    setTimeout("CompoundViewEditor.refreshData();",5000);

    Try it out ;)
  • 6. Re: Auto Refresh an Analysis in Dashboard
    649804 Newbie
    Currently Being Moderated
    Hi Veeravalli, thanks for the suggestion. The code works if I'm inside the analysis editor (Answers). But when I'm in the dashboard prompt, the code doesn't do anything.

    I check using FireBug that the Refresh link code (if I show the Refresh link of this analysis in the dashboard) is:
    [a name="SectionElements" title="Refresh the results of the current analysis" onclick="javascript:HereLink('d:dashboard~p:39n8jdul06hbte1l~r:pfaol71hqq94l075','Refresh'); return false;" href="javascript:void(0)"]Refresh[a]

    I tried using this code below in my dashboard, but it didn't work:
    [script type="text/JavaScript"]
    [!--
    setTimeout("HereLink('d:dashboard~p:39n8jdul06hbte1l~r:pfaol71hqq94l075','Refresh');",5000);

    // --]
    [script]

    Any suggestions, anyone? Thanks so much!

    P.S.: all [ ] in the code above are replaced with less than and greater than symbols
  • 7. Re: Auto Refresh an Analysis in Dashboard
    Srini VEERAVALLI Guru
    Currently Being Moderated
    Try this

    <script type="text/JavaScript">
    <!--
    setTimeout("javascript:HereLink('d:dashboard~p:i3pub16he83q7e9c~r:qqq9loggk8hvpl85','Refresh');",5000);
    alert("hai");
    // -->
    </script>

    First 2 times I see its working.. after that not able to notice ;)

    If helps pls mark :)
  • 8. Re: Auto Refresh an Analysis in Dashboard
    649804 Newbie
    Currently Being Moderated
    Hi Veeravalli, thanks for your advice, but it doesn't work. It only shows "hai" text the first time. No query was re-sent based on what I see in the Manage Sessions menu.
  • 9. Re: Auto Refresh an Analysis in Dashboard
    Srini VEERAVALLI Guru
    Currently Being Moderated
    At last working code :)
    The below code use in Text object by selecting code for HTML, when you are using it pls uncomment or take out // to see results. To test this I've tried using time for each 5 seconds interval.

    Session log may not be valid case if you enable cache..

    &lt;!DOCTYPE html&gt;
    &lt;html&gt;
    &lt;body&gt;

    &lt;p&gt;A script on this page starts this clock:&lt;/p&gt;
    &lt;p id="demo"&gt;&lt;/p&gt;

    &lt;script&gt;
    var myVar=setInterval(function(){myTimer()},5000);

    function myTimer()
    {
    var d=new Date();
    var t=d.toLocaleTimeString();
    //document.getElementById("demo").innerHTML=t;
    //setTimeout("javascript:HereLink('d:dashboard~p:i3pub16he83q7e9c~r:qqq9loggk8hvpl85','Refresh');",5000);
    //or
    //setTimeout("HereLink('d:dashboard~p:i3pub16he83q7e9c~r:qqq9loggk8hvpl85','Refresh');",5000);
    }
    &lt;/script&gt;

    &lt;/body&gt;
    &lt;/html&gt;
  • 10. Re: Auto Refresh an Analysis in Dashboard
    649804 Newbie
    Currently Being Moderated
    Hi Veeravalli, your solution works perfectly! Thanks so much for this.

    I just need one small help from you. When I show the dashboard the first time, the last refreshed Time is not shown. Only after first auto-refresh is the last refresh time shown.

    Could you please advise on how to make the time available even for the first time? Thanks in advance!
  • 11. Re: Auto Refresh an Analysis in Dashboard
    Srini VEERAVALLI Guru
    Currently Being Moderated
    haaa.. I too noticed this. I was assuming the load time of the report and the page causing this to miss..
  • 12. Re: Auto Refresh an Analysis in Dashboard
    sayak Explorer
    Currently Being Moderated
    Hi Veeravalli ,

    If I place my analysis location like this :
    setTimeout("HereLink('*/Shared Folders/Inteliplan dashboards/Dashboard contents/PnL dashboard contents/by Product* ','Refresh');",5000);

    I tried like this .... it didn't gave any error ... but i am not sure wether its refreshing the analysis (which is on the mentioned dashboard path ) .

    Thanks

    sayak

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points