myDBR group by not working

(5 posts) (2 voices)
  1. SongezoM, Member

    Hi,

    I'm trying to group a field called Designation but myDBR is not doing this properly. There are values that are duplicated

    I'm using select 'dbr.hdr', 'Designation'; to make this happen - the grouping works but the same designation (e.g. Java Developer) is split into multiple groups.

    Thanks,
    Songezo

  2. myDBR Team, Key Master

    Have you sorted the data based on Designation?

    select ...
    from ...
    where ...
    order by Designation

    If the problem persists, could you show the query you are using.

    --
    myDBR Team

  3. SongezoM, Member

    select 'dbr.count', 'Name';
    select 'dbr.hdr', 'Designation';

    select t.designation 'Designation', c.competency_c 'Master Category',
    concat(t.first_name, ' ',t.last_name) 'Name',
    c.region_c 'Region',
    case c.business_unit_c
    when 'BI' then 'BI Team'
    when 'SUP' then 'Support Staff'
    when 'MNG' then 'Management'
    else replace(business_unit_c, '_', ' ')
    end 'Business Area',
    a.name 'Based at',
    concat(u.first_name, ' ', u.last_name) 'Reports to',
    c.type_c 'Contractual/Permanent'
    from teammember_cstm c
    left outer join teammember t on (t.id = c.id_c and t.deleted = 0)
    left outer join users u on u.id = t.user_id1_c
    left outer join accounts a on c.account_id_c = a.Id
    where a.deleted = 0
    and c.status_c ='Active' and (type_c in (select tType from teammember_types)) and
    Company_c = inCompany
    end
    and c.status_c ='Active'
    and t.deleted=0
    and (c.region_c = inRegion or inRegion = 'All')
    order by 1; -- 1 being designation

  4. myDBR Team, Key Master

    One option is that there is something in the data that causes this.

    Could you run the report using "Output as SQL" and send the generated code to support email so we can take a look.

    --
    myDBR Team

  5. SongezoM, Member

    I've sorted this out thanks. It was caused by spaces in the data so all I did was trim leading and trailing spaces from the designation names and now it's flying.

    Thanks a lot
    Songezo


Reply

You must log in to post.