Clarity

  • 1.  I am trying to order an NSQL with the "order by" statement but I do not get results.

    Posted Jul 11, 2018 12:20 PM

    this is my query

     

    SELECT @SELECT:DIM:USER_DEF:IMPLIED:HORAS:T.res_id:id@,
    @SELECT:DIM_PROP:USER_DEF:IMPLIED:HORAS:T.full_name:name_resource@,
    @SELECT:DIM_PROP:USER_DEF:IMPLIED:HORAS:T.resource_email:resource_email@,
    @SELECT:DIM_PROP:USER_DEF:IMPLIED:HORAS:T.team_lider:team_lider@,
    @SELECT:DIM_PROP:USER_DEF:IMPLIED:HORAS:T.team_lider_email:team_lider_email@,
    @SELECT:DIM:USER_DEF:IMPLIED:PERIODO:T.fecha:Fecha@,
    @SELECT:DIM_PROP:USER_DEF:IMPLIED:HORAS:T.activo_n:activo_n@,
    @SELECT:DIM_PROP:USER_DEF:IMPLIED:HORAS:T.role_full_name:role_full_name@,
    @SELECT:METRIC:USER_DEF:IMPLIED:case when T.obsn = 0 then 'ok' else '.ERR' end:Obs@

    FROM

    ( ...
    ) T

     

    where
    @FILTER@
    ORDER BY team_lider

     

    I execute it via xog

    I get an order by T.res_id


  • 2.  Re:  I am trying to order an NSQL with the "order by" statement but I do not get results.

    Posted Jul 11, 2018 04:46 PM

    My thinking is that order by does not work in NSQL as those queries are meant for portlets where the sorting is in the portlets definitions.

     

    Have you tried to put the query inside an SQL wrapper then use that as the source/from  for the NSQL



  • 3.  Re:  I am trying to order an NSQL with the "order by" statement but I do not get results.

    Posted Jul 14, 2018 08:29 PM

    When you say you execute it via XOG, you mean to say you are calling the NSQL WSDL Query to get results out as XML, but the records in the resulting XML are sorted by T.res_id?

     

    If so, you can provide sorting options dynamically (i.e. not hard coded in the query) by ensuring it has a where @FILTER@ section and then placing the correct section into your query read request:

     

          <quer:Query>
             <quer:Code>replace_with_your_query_code</quer:Code>
             <quer:Sort>
                <quer:Column>
                   <quer:Name>team_lider</quer:Name>
                   <!--Optional:-->
                   <quer:Direction>asc</quer:Direction>
                </quer:Column>
             </quer:Sort>
          </quer:Query>

     

    You can use the community/free edition of SoapUI to help generate and test a query request with different parameters to see if you can get the results in the order you seek.

     

    If I've misunderstood, please provide more details for the challenge you are facing.