0 Replies Latest reply on Jan 31, 2013 1:05 PM by dmease729

    Trying to get juicy pie chart from ad hoc query

    dmease729

      Hi,

       

      I am looking to try to browse direct to the output of an ad hoc query, when that output is a pie chart.  I am not sure if this is possible, so am wondering if somebody could give me a 'no' or nudge me in the right direction.  I have been playing around with a simple query of displaying agent versions for managed systems.

       

      Yes, I am going for a quick answer, but I am still digging around at the moment.  I am *guessing* that there is specific code behind the pie charts that parses the query XML, and this may not be possible at present (or at least possible in a relatively simple manner!)

      cheers,

       


      My stumbling around/playing has gotten me a little more used to what is going on:

       

      Query export:
      <queries>
      <query>
        <name language="en">Query: Managed Agent Versions</name>
        <description language="en"></description>
        <property name="target">EPOLeafNode</property>
        <property name="tableURI">query:table?orion.table.columns=EPOLeafNode.NodeName%3AEPOProdP ropsView_EPOAGENT.hotfix%3AEPOProdPropsView_EPOAGENT.productversion&amp;orion.ta ble.order=az&amp;orion.table.order.by=EPOLeafNode.NodeName%3AEPOProdPropsView_EP OAGENT.hotfix%3AEPOProdPropsView_EPOAGENT.productversion</property>
        <property name="conditionURI">query:condition?orion.condition.sexp=%28+where+%28+stateEq+ EPOLeafNode.ManagedState+%22managed%22+%29+%29</property>
        <property name="summaryURI">query:summary?orion.query.type=pie.pie&amp;orion.sum.query=tr ue&amp;show.percentage=false&amp;orion.sum.group.by=EPOProdPropsView_EPOAGENT.pr oductversion&amp;orion.sum.order=desc&amp;orion.sum.limit.count=360&amp;orion.su m.aggregation=count&amp;orion.sum.aggregation.showTotal=true</property>
      </query>
      </queries>


      Translation (original attempt and now working):

       

      DOES NOT WORK (receives 'Conversion failed when converting from a character string to uniqueidentifier'):
      https://<server>:<port>/remote/core.executeQuery?target=EPOLeafNode&select=(sele ct
      EPOLeafNode.NodeName EPOProdPropsView_EPOAGENT.hotfix EPOProdPropsView_EPOAGENT.productversion)&where=(where(eq EPOLeafNode.ManagedState "managed"))&order=(order(asc EPOLeafNode.NodeName))

       

      WORKS (removed where clause to troubleshoot):
      https://<server>:<port>/remote/core.executeQuery?target=EPOLeafNode&select=(sele ct
      EPOLeafNode.NodeName EPOProdPropsView_EPOAGENT.hotfix EPOProdPropsView_EPOAGENT.productversion)&order=(order(asc EPOLeafNode.NodeName))

       

      Looking at https://<server>:<port>/remote/core.listTables, I found that ManagedState field was of type managedState, and not of type string.
      Looking at https://<server>:<port>/remote/core.listDatatypes, I can see that the allowed operations list is limited to: stateEq, soo realising that I had not seen the 'state' bit in the query export....

       

      https://<server>:<port>/remote/core.executeQuery?target=EPOLeafNode&select=(sele ct EPOLeafNode.NodeName EPOProdPropsView_EPOAGENT.hotfix EPOProdPropsView_EPOAGENT.productversion)&where=(where(stateEq EPOLeafNode.ManagedState "managed"))&order=(order(asc EPOLeafNode.NodeName))

      and voila!