Error when export to excel

(4 posts) (2 voices)

Tags:

  1. dotb, Member

    Hi,
    When i export to excel, i get error data .
    https://www.dropbox.com/s/2thu8z4zdlonuh8/error.PNG?dl=0
    Please fix me.
    Thanks

  2. myDBR Team, Key Master

    Hi,
    could you open a support ticket and attach the report output with '&export=sql' added to the URL. This way we can replicate your setup.

    --
    myDBR Team

  3. dotb, Member

    Hi,
    Here is output

    select 'dbr.resultclass', 'mytable';

    select 'dbr.javascript', '
    $(\'<tr><th class="cell_ct_top" colspan="2"></th><th class="cell_ct_top" colspan="3">Value</th><th class="cell_ct_top" colspan="3">% Shared by Brand</th><th class="cell_ct_top" colspan="3">% Shared by Total</th></tr>\').insertBefore($(\'.mytable thead tr\'));
    $(\'.mytable thead tr th.cell_header\').removeClass(\'cell_header\').addClass(\'cell_ct\');
    ', 'onload';

    select 'dbr.title', 'IT REPORT: BRAND IMPORTER - VALUE (11/2014)';
    select 'dbr.text', 'Latest Data: 2014-11-01';
    select 'dbr.subtitle', 'Brand Importer All Category (Value)';

    select 'dbr.hdr', 'Brand';

    select 'dbr.count', 'Importer';
    select 'dbr.summary.text', 'Brand', 'Total';
    select 'dbr.sum', 'YTD', 'YTD-1', 'ytd_brand_percent', 'ytd_1_brand_percent', 'ytd_all_percent', 'ytd_1_all_percent', 'ytd_brand_diff_percent', 'ytd_all_diff_percent';

    select 'dbr.hidecolumn', 'rYTD', 'rYTD-1';

    select 'dbr.calc', 'ytd_diff_percent', '(([YTD]-[YTD-1])*100/[YTD-1])';
    select 'dbr.calc', 'ytd_brand_diff_percent', '[ytd_brand_percent] - [ytd_1_brand_percent]';
    select 'dbr.calc', 'ytd_all_diff_percent', '([ytd_all_percent] - [ytd_1_all_percent])';

    select 'dbr.column.title', '[YTD]', 'YTD 14';
    select 'dbr.column.title', '[YTD-1]', 'YTD 13';
    select 'dbr.column.title', 'ytd_diff_percent', 'PY Growth %';
    select 'dbr.column.title', 'ytd_brand_percent', 'YTD 14';
    select 'dbr.column.title', 'ytd_1_brand_percent', 'YTD 13';
    select 'dbr.column.title', 'ytd_brand_diff_percent', 'Diff';
    select 'dbr.column.title', 'ytd_all_percent', 'YTD 14';
    select 'dbr.column.title', 'ytd_1_all_percent', 'YTD 13';
    select 'dbr.column.title', 'ytd_all_diff_percent', 'Diff';

    select 'dbr.colstyle', 'ytd_diff_percent', '[color: green]%.1f; ;[color: red;]%.1f';
    select 'dbr.colstyle', 'ytd_brand_diff_percent', '[color: green]%.1f; ;[color: red;]%.1f';
    select 'dbr.colstyle', 'ytd_all_diff_percent', '[color: green]%.1f; ;[color: red;]%.1f';
    select 'dbr.colstyle', 'ytd_brand_percent', '%.1f';
    select 'dbr.colstyle', 'ytd_1_brand_percent', '%.1f';
    select 'dbr.colstyle', 'ytd_all_percent', '%.1f';
    select 'dbr.colstyle', 'ytd_1_all_percent', '%.1f';

    select 'Samsung' as 'Brand[Brand]', 'SSVN' as 'Importer[Importer]', 444229957 as 'YTD[YTD]', 335590609 as 'YTD-1[YTD-1]', null as '+/-[ytd_diff_percent]', 446442486 as 'rYTD[rYTD]', 338145140 as 'rYTD-1[rYTD-1]', 99.504400 as 'YTD[ytd_brand_percent]', 99.244500 as 'YTD-1[ytd_1_brand_percent]', null as '+/-[ytd_brand_diff_percent]', 25.985700 as 'YTD[ytd_all_percent]', 18.576400 as 'YTD-1[ytd_1_all_percent]', null as '+/-[ytd_all_diff_percent]'
    union all
    select 'Samsung', 'AAAA', 126, 0, null, 446442486, 338145140, 0.000000, 0.000000, null, 0.000000, 0.000000, null
    union all
    select 'Samsung', '<others>', 2212403, 2554531, null, 446442486, 338145140, 0.495600, 0.755500, null, 0.129400, 0.141400, null
    union all
    select 'Lenovo', 'SSVN', 8782, 0, null, 47624699, 34834669, 0.018400, 0.000000, null, 0.000500, 0.000000, null
    union all
    select 'Lenovo', 'PSD', 11632749, 8337246, null, 47624699, 34834669, 24.425900, 23.933800, null, 0.680500, 0.461500, null
    union all
    select 'Lenovo', 'GDS VN', 459, 0, null, 47624699, 34834669, 0.001000, 0.000000, null, 0.000000, 0.000000, null
    union all
    select 'Lenovo', 'AAAA', 11829619, 12089532, null, 47624699, 34834669, 24.839300, 34.705500, null, 0.692000, 0.669200, null
    union all
    select 'Lenovo', 'DGW', 15639154, 4617764, null, 47624699, 34834669, 32.838300, 13.256200, null, 0.914800, 0.255600, null
    union all
    select 'Lenovo', '<others>', 8513936, 9790127, null, 47624699, 34834669, 17.877100, 28.104600, null, 0.498000, 0.541900, null
    union all
    select 'Intel', 'Viết Sơn', 51447141, 42629233, null, 82184785, 70898539, 62.599300, 60.127100, null, 3.009500, 2.359700, null
    union all
    select 'Intel', 'Viễn Sơn', 14025886, 994315, null, 82184785, 70898539, 17.066300, 1.402400, null, 0.820500, 0.055000, null
    union all
    select 'Intel', 'SSVN', 5010, 516, null, 82184785, 70898539, 0.006100, 0.000700, null, 0.000300, 0.000000, null
    union all
    select 'Intel', 'PSD', 8560, 0, null, 82184785, 70898539, 0.010400, 0.000000, null, 0.000500, 0.000000, null
    union all
    select 'Intel', 'HP VN', 16451, 156, null, 82184785, 70898539, 0.020000, 0.000200, null, 0.001000, 0.000000, null
    union all
    select 'Intel', 'AAAA', 316335, 6924764, null, 82184785, 70898539, 0.384900, 9.767100, null, 0.018500, 0.383300, null
    union all
    select 'Intel', '<others>', 16365402, 20349555, null, 82184785, 70898539, 19.912900, 28.702400, null, 0.957300, 1.126400, null
    ;

  4. myDBR Team, Key Master

    The problem is a rounding error when calculating with floats.

    You have also unneccessary dbr.sum for calculation columns causing the summary row calculation done from each row as opposed to summary row which myDBR would do automatically.

    You should remove the calc columns from dbr.sum:

    select 'dbr.sum', 'YTD', 'YTD-1', 'ytd_brand_percent', 'ytd_1_brand_percent', 'ytd_all_percent', 'ytd_1_all_percent'

    To make sure you do not get rounding errors, you can round your calculations:

    select 'dbr.calc', 'ytd_brand_diff_percent', 'round(round([ytd_brand_percent],1) - round([ytd_1_brand_percent],1),1)';
    select 'dbr.calc', 'ytd_all_diff_percent', 'round(round([ytd_all_percent],1) - round([ytd_1_all_percent],1),1)';

    We'll fix the issue for column style not correctly applied to Excel export summary rows.

    --
    myDBR Team


Reply

You must log in to post.