This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

SQL Filter to Limit Report to Current Node

I need some help to create an SQL filter for a Report on my web page.

The report shows all nodes...bytes....for last 7 days.

I need the filter on the web page to only show the Current Node results and not all nodes.

Without the Filter.......my report shows every single node. 

I had it working for years....but somehow during the upgrade to 9.5 things got messed up and now my filter is gone and for the life of me I can't remember how I did it.

Thanks,

Dave

  • Hi Dave,

    I'm not sure what you mean by the Current Node.

    Andy

  • Thanks Andy.

    I have a Node....Lets say Node X.

    I have created a view of statistics...traffic stats etc.

    When i click on Node X...up comes my view with the info.

    Working good so far.

    In my view I have a Report from Report Writer.  The report in Report Writer shows ALL Nodes traffic in bytes for 7 Days.  In my view.....I only want the chart to show Node X and not all nodes on my network.

    When I click on Node Y....I want Node Y's info from the report and not all.

    When I click on Node Z....I want Node Z's info from the report and not all.

    I had it working....with a Filter in there.....that I created with the Help of Solarwinds Support a few years back.  Since my upgrade to 9.5......I lost the filter.

    Now when I open the view.......the chart loads All Nodes.

    The filter needs to Pull from the Report only the NodeID that I am currently looking at.  So some sort of Dynamic filter I would suppose. 

    Thanks,

    Dave

  • OK -  that's a bit clearer. I hacked at it for a while but couldn't get the sql filter. Maybe a community member could help here?

  • Whats the chance that somewhere in the backup that I did before the Upgrade to 9.5......that I might find  the filter that I was using???

    Any idea where that might be stored???

    Thanks,

    Dave

  • Have you tried something like this for your filter?

    NodeID = ${NodeID}

  • Thanks.  Yes I just tried it.  Does not work.

    Error is.....

    System.Data.SqlClient.SqlException: Ambiguous column name 'NodeID'. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlDataReader.ConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior) at SolarWinds.Orion.Common.SqlHelper.ExecuteReader(SqlCommand command) at SolarWinds.Orion.Web.Reporting.OrionReport.QueryData(String query, String orderBy, String grouping, String filter, Dictionary`2 macroContext) at SolarWinds.Orion.Web.Reporting.ReportRunner.WorkerProc()

  • OK.  Try this instead.  NodeID = ${Nodes.NodeID}

  • I had the syntax backwards in the previous post so please ignore that one.  try this:

    Nodes.NodeID = ${NodeID}

  • Making progress now.....No error....but the report is blank.

    I can make it work if I put in.......

    Nodes.Caption = 'XYZ Node'

    But i need it to automatically grab the Current Node.

    Should we be using Nodes.Caption ...something something something ?????

    What does the ${    } do???

    Thanks,

    Dave

  • Since this is a report for interface information try using...

    interfaces.NodeID = ${NodeID}

     

    ${NodeID} is a variable that should contain the current NodeID.