Cross Tabulation issue

(2 posts) (2 voices)

Tags:

No tags yet.

  1. bushraj, Member

    Hey ,

    I'm using cross tabulation in which i have two regions TPSPakistan and TPSME . But it is showing TPSPakistan twice. Why?

    here is the code:

    DROP PROCEDURE IF EXISTS sp_DBR_Project_regionwise
    $$
    CREATE PROCEDURE sp_DBR_Project_regionwise()
    begin

    select 'dbr.crosstab', 2;

    SELECT Level,c.Office_Division as region,sum(duration/60) as 'Duration'

    FROM timesheets.tps_trans_effort_timeline t,wf_workflow.users u,

    wf_workflow.tps_lut_customusers c

    where
    t.usr_uid=u.usr_uid

    and u.usr_username=c.Employee_Domain_ID

    group by 1,2;
    end
    $$

    And the output is :

    region

    TPSPakistan TPSME TPSPakistan
    Level Duration Duration Duration
    Level - 1 10122.97
    Level - 10 129.20
    Level - 2 27727.45
    Level - 3 32601.73
    Level - 4 62057.90 4.35
    Level - 5 289.75 3932.05
    Level - 6 4838.98
    Level - 7 269.00

    I want it like this :

    region

    TPSPakistan TPSME
    Level Duration Duration
    Level - 1 10122.97
    Level - 10 129.20
    Level - 2 27727.45
    Level - 3 32601.73
    Level - 4 62057.90 4.35
    Level - 5 3932.05 289.75
    Level - 6 4838.98
    Level - 7 269.00

    What I m doing wrong here? Please help.

    Regards,

    Bushra

  2. myDBR Team, Key Master

    Without seeing the actual data, the first quess would be that there is a spelling difference between the two 'TPSPakistan' strings (invisible character?).

    If you use Output as SQL statement when excuting the report in SQL Editor you will get a result we can also take a look. If you do not want to expose your data in the forum, you can use the support email address.

    --
    myDBR Team


Reply

You must log in to post.