SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 5 of 5
  1. #1
    Senior Member
    Join Date
    Aug 2004
    Location
    Bloomington, IL
    Posts
    300
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    How to get the requirements in excel order by

    Hi,

    I am trying to get the requirements into excel same as in the order of requirement tree. I tried using the below querym, but no use..

    SELECT Rq_Req_Id FROM Req order by Rq_Req_Path

    Can anyone please let me know how to get the requirements order by.

    Thanks,
    Shiva

  2. #2
    Advanced Member
    Join Date
    Aug 2004
    Location
    Wellington, New Zealand
    Posts
    797
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0

    Re: How to get the requirements in excel order by

    select RQ_REQ_ID
    from REQ
    order by RQ_REQ_PATH, RQ_ORDER_ID
    Regards,

    Alex
    ... just another Tester ...

  3. #3
    Apprentice
    Join Date
    Jul 2010
    Location
    CA, US
    Posts
    43
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to get the requirements in excel order by

    Sometimes values in the rq_order_id and rq_req_path fields donít match. To get the exact order we can re-construct the path by using hierarchical query like this one:

    with req_folders(id, parent_id, req_name, real_order, rq_req_path) as (
    select rq_req_id as id, rq_father_id as parent_id, rq_req_name as req_name,
    cast(100+rq_order_id as varchar(255)) as real_order, rq_req_path
    from req
    where rq_father_id<0
    union all
    select rq_req_id, rq_father_id, rq_req_name,
    cast(real_order+'-'+cast(100+rq_order_id as varchar(3)) as varchar(255)), req.rq_req_path
    from req join req_folders on rq_father_id=id
    )
    select * from req_folders
    order by real_order
    I use HP QC reports from www.rbreporting.com

  4. #4
    Advanced Member
    Join Date
    Aug 2004
    Location
    Wellington, New Zealand
    Posts
    797
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0

    Re: How to get the requirements in excel order by

    According tot he DB reference:

    [ QUOTE ]

    RQ_REQ_PATH: "The requirement path in the requirements hierarchy."
    RQ_REQ_ORDER_ID: "The order in which the requirement appears in the user interface among other requirements at the same level of the requirements hierarchy."


    [/ QUOTE ]

    In other words:
    REQ_PATH gives you the branch of the req tree
    REQ_ORDER gives you the order within that branch

    It's what the UI uses to render the tree.

    Also in the DB reference:

    [ QUOTE ]

    The tree structure is stored in two ways. First, each record holds a pointer to the parent in RQ_FATHER_ID. Within the children of each parent, the order is set with RQ_ORDER_ID. Thus, a self-join between REQ parent and REQ child ordered by child.RQ_FATHER_ID, child.RQ_ORDER_ID can be used to recreate the tree.

    The second way the tree is stored is in RQ_REQ_PATH. The highest level nodes (RQ_FATHER_ID = -1) are ordered from AAA to ZZZ. Each child node down the tree inherits the parent path, and within the parent node, the requirements are ordered AAA to ZZZ where the current level numeration is concatenated to the inherited path. For example, the child requirements of the first node (AAA) have paths of AAAAAA, AAAAAB, AAAAAC, and so on.

    Use of a self-join is easy to program when recreating the entire tree or a sub-tree. The path can be used when looking for the children of a given node since the child paths are the parent path plus three more characters.


    [/ QUOTE ]
    Regards,

    Alex
    ... just another Tester ...

  5. #5
    Senior Member
    Join Date
    Aug 2004
    Location
    Bloomington, IL
    Posts
    300
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to get the requirements in excel order by

    Thx for the detailed explanation.... :-)

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.71%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 02:08 AM.

Copyright BetaSoft Inc.