Results 1 to 2 of 2

Thread: Calculate connected links lengths for nodes

  1. #1

    Join Date
    Mar 2013
    Posts
    1

    Calculate connected links lengths for nodes

    I am trying to calculate main lengths for assigning leakage on nodes as 'leakage by main length' values. The query below does calculate main lengths for the nodes connected to more than one link, but it returns null values for the end nodes (nodes connected to only one link). Is there a better way of doing this?
    SELECT node_id, SUM(ds_links.length) + SUM(us_links.length))

    qry_Node_mainlegths.jpg

  2. #2

    Join Date
    Oct 2014
    Posts
    1

    SQL Query

    Hi
    I am not sure if it is too late to reply to this but the query below will make it work, I have chosen user_number_1 but you can use any unused user number column:

    SET user_number_1 = SUM(ds_links.length) + SUM(us_links.length) WHERE SUM(ds_links.length) > 0 AND SUM(us_links.length) > 0;
    SET user_number_1 = SUM(ds_links.length) WHERE SUM(us_links.length) = "";
    SET user_number_1 = SUM(us_links.length) WHERE SUM(ds_links.length) = "";
    SELECT node_id AS 'Node ID', user_number_1 AS 'Main Length';

    Regards

    Nishant

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •