dbr.calc calculate both another group row?

(9 posts) (2 voices)

Tags:

No tags yet.

  1. spyhunter88, Member

    Hi myDBR Team,

    I used both 'dbr.calc' and 'skip_single_line_summary' and found the total row was calculate with the single line in previous group. I dont have sample here but I think you can understand the problem.

    I have first row with no total row follows (because I use 'skip_single_line_summary'), after that I have the second, third, fourth row in a group. After that, the fifth row is summary of 4 previous rows. Other columns work, but the column set by 'dbr.calc' calculate the first row.

    Sample: if I use select 'dbr.calc', 'diff', '[col1]-[col2]'; the total in the fifth row must be SUM(col1-col2) from the second to the fourth, but in the report it's SUM(col1-col2) from the first.

    But the Total row of all is right. :D Please check this, if you can not debug I can copy a part of my export=sql.

    Thanks,

    PS: sorry, another thing I want to report is I can not use new_popup inside button? I change to new_popup, the button shows up but does nothing.

    select 'dbr.report', 'sp_DBR_INV_Item_Details', 'new_window', 'inDate=(inDate)', 'inStatus=(inStatus)';
    select 'dbr.button', 'Over 120 Days';

    And can I use 'no_tooltips' in a "settings for all" mode? Like a global variables or in config file? I have hundred of reports and I don't want to add manually.

  2. myDBR Team, Key Master

    But the Total row of all is right. :D Please check this, if you can not debug I can copy a part of my export=sql.

    Please do show export=sql. It makes checking things much easier as we do not have to quess what exactly you are out after. You can also use support email if your question is specific to your case.

    PS: sorry, another thing I want to report is I can not use new_popup inside button? I change to new_popup, the button shows up but does nothing.

    dbr.button does support all the linked report targets (including popups). Is the behavior different if you leave out the dbr.button-command?

    And can I use 'no_tooltips' in a "settings for all" mode?

    There is no global setting for 'no_tooltips'. We can add one if you need it.

    --
    myDBR Team

  3. spyhunter88, Member

    1. For Total row, I made a simple but this works, I tried to limit my row number and show the issue. If you look at the picture, you see the Total (red rectangle) = SUM of some above and another cell (black rectangle).

    And the code:

    select 'dbr.title', 'REPORT by DAY: 2014-07-31';
    
    select 'dbr.crosstab.col', 'Mon 28/07';
    select 'dbr.crosstab.col', 'Tue 29/07';
    select 'dbr.crosstab.col', 'Wed 30/07';
    select 'dbr.crosstab.col', 'Thu 31/07';
    
    select 'dbr.column.filter', 'Company', 'select';
    select 'dbr.column.filter', 'BU', 'select';
    select 'dbr.column.filter', 'Center', 'select';
    select 'dbr.column.filter', 'Dept', 'select';
    
    select 'dbr.hidecolumn', 'Center', 'Dept';
    
    select 'dbr.hdr', 'Company';
    
    select 'dbr.summary.text', 'Company', 'Total';
    
    select 'dbr.crosstab', 'WDate', 'Sale';
    select 'dbr.crosstab.title', 'Total';
    
    select 'dbr.sum', 'Sale', 'Week_Sales', 'Month_Sales', 'Week_GP', 'Month_GP', 'Week_Target', 'Month_Target';
    select 'dbr.summary.options', 'skip_single_line_summary';
    
    select 'dbr.hidecolumn', 'Wcolor', 'Mcolor', 'WeekDate';
    
    select 'dbr.calc', 'target_week_percent', '([Week_Sales]/[Week_Target]*100)';
    select 'dbr.calc', 'gp_week_percent', '([Week_GP]/[Week_Sales]*100)';
    select 'dbr.calc', 'target_month_percent', '([Month_Sales]/[Month_Target]*100)';
    select 'dbr.calc', 'gp_month_percent', '([Month_GP]/[Month_Sales]*100)';
    select 'dbr.calc', 'week_diff', '([Week_Sales]-[Week_Target])';
    select 'dbr.calc', 'month_diff', '([Month_Sales]-[Month_Target])';
    
    select 'dbr.column.title', 'target_week_percent', '%Target';
    select 'dbr.column.title', 'target_month_percent', '%Target';
    select 'dbr.column.title', 'gp_week_percent', '%GP';
    select 'dbr.column.title', 'gp_month_percent', '%GP';
    select 'dbr.column.title', 'week_diff', 'Diff';
    select 'dbr.column.title', 'month_diff', 'Diff';
    
    select 'dbr.footerstyle', 'background-color: #F7F2E0;font-weight: normal;color:#0101DF;';
    select 'dbr.colstyle', 'Week_Target', '[background-color: #CCEEFF;font-weight: bold;]%.0f';
    select 'dbr.colstyle', 'Month_Target', '[background-color: #CCEEFF;font-weight: bold;]%.0f';
    select 'dbr.colstyle', 'Week_Sales', '[background-color: yellow;font-weight: bold;] %.0f';
    select 'dbr.colstyle', 'Month_Sales', '[background-color: yellow;font-weight: bold;] %.0f';
    select 'dbr.colstyle', 'Week_GP', '[color: green]%.0f; ;[color: red;]%.0f';
    select 'dbr.colstyle', 'Month_GP', '[color: green]%.0f; ;[color: red;]%.0f';
    select 'dbr.colstyle', 'gp_week_percent', '[color: green]%.2f; ;[color: red;]%.2f';
    select 'dbr.colstyle', 'gp_month_percent', '[color: green]%.2f; ;[color: red;]%.2f';
    select 'dbr.colstyle', 'week_diff', '[color: green]%.0f; ;[color: red;]%.0f';
    select 'dbr.colstyle', 'month_diff', '[color: green]%.0f; ;[color: red;]%.0f';
    select 'dbr.cellclass', 'target_week_percent', '[Wcolor]';
    select 'dbr.cellclass', 'target_month_percent', '[Mcolor]';
    select 'dbr.colstyle', 'Sale', '%.0f';
    
    select 'F1' as 'Company[Company]', 'L1' as 'BU[BU]', '' as 'Center[Center]', '' as 'Dept[Dept]', 'Mon 28/07' as 'Date[WDate]', cast('2014-07-28' as date) as 'W[WeekDate]', 2977.171800 as '[Sale]', 60191.758400 as 'Sales[Week_Sales]', 14712.903300 as 'Target[Week_Target]', null as 'week_diff', null as 'target_week_percent', -4118.393300 as 'GP[Week_GP]', null as 'gp_week_percent', 12752.909100 as 'Sales[Month_Sales]', 53560.000000 as 'Target[Month_Target]', null as 'month_diff', null as 'target_month_percent', -4118.393300 as 'GP[Month_GP]', null as 'gp_month_percent', 'text_green' as '[Wcolor]', 'text_red' as '[Mcolor]'
    union all
    select 'F1', 'L1', '', '', 'Thu 31/07', cast('2014-07-31' as date), 2914.951100, 60191.758400, 14712.903300, null, null, -4118.393300, null, 12752.909100, 53560.000000, null, null, -4118.393300, null, 'text_green', 'text_red'
    union all
    select 'F1', 'L1', '', '', 'Tue 29/07', cast('2014-07-29' as date), 1576.298700, 60191.758400, 14712.903300, null, null, -4118.393300, null, 12752.909100, 53560.000000, null, null, -4118.393300, null, 'text_green', 'text_red'
    union all
    select 'F1', 'L1', '', '', 'Wed 30/07', cast('2014-07-30' as date), 5284.487600, 60191.758400, 14712.903300, null, null, -4118.393300, null, 12752.909100, 53560.000000, null, null, -4118.393300, null, 'text_green', 'text_red'
    union all
    select 'HO', 'Others', '', '', null, null, null, null, 24885.592200, null, null, null, null, null, 20052.622200, null, null, null, null, 'text_red', 'text_red'
    union all
    select 'M1', 'M1', '', '', null, null, null, 16931.224600, 3525.806400, null, null, 16931.224600, null, null, 14800.000000, null, null, 16931.224600, null, 'text_green', 'text_red'
    union all
    select 'Internal', 'F1', '', '', null, null, null, -11.872000, null, null, null, 0.015600, null, null, null, null, null, 0.015600, null, 'text_red', 'text_red'
    union all
    select 'Internal', 'F2', '', '', 'Thu 31/07', cast('2014-07-31' as date), -949.872700, -13195.606600, null, null, null, 338.956300, null, -1286.745500, null, null, null, 338.956300, null, 'text_red', 'text_red'
    union all
    select 'Internal', 'F2', '', '', 'Tue 29/07', cast('2014-07-29' as date), -336.872800, -13195.606600, null, null, null, 338.956300, null, -1286.745500, null, null, null, 338.956300, null, 'text_red', 'text_red'
    union all
    select 'Internal', 'F3', '', '', 'Mon 28/07', cast('2014-07-28' as date), -108.250000, -674.611500, null, null, null, -668.461200, null, -530.361500, null, null, null, -668.461200, null, 'text_red', 'text_red'
    union all
    select 'Internal', 'F3', '', '', 'Thu 31/07', cast('2014-07-31' as date), -422.111500, -674.611500, null, null, null, -668.461200, null, -530.361500, null, null, null, -668.461200, null, 'text_red', 'text_red';

    2. I create a dbr.purehtml and put some buttons into a table to make they look like a grid.

    select 'dbr.purehtml', '<table class="wrapper_table" style="width: 100%;"><tr><td align="center">';
    select 'dbr.report', 'sp_DBR_INV_Item_Details', 'new_window', 'inDate=(inDate)', 'inStatus=(inStatus)';
    select 'dbr.button', 'Over 120 Days';
    select '1';
    select 'dbr.purehtml', '</td><td align="center">';
    -- another button
    select 'dbr.purehtml', '</td></tr></table>';

    3. I'll appreciate very much if it becomes and option or easy configuration.

    Thanks,

  4. myDBR Team, Key Master

    Hi,

    1. For Total row, I made a simple but this works, I tried to limit my row number and show the issue. If you look at the picture, you see the Total (red rectangle) = SUM of some above and another cell (black rectangle).

    We'll take a look at this.

    2. I create a dbr.purehtml and put some buttons into a table to make they look like a grid.

    The table wrapper should not not have any impact on behavior. The new_window target should open the sp_DBR_INV_Item_Details report in new window.

    So what happens excatly if you press the button? Is the behavior different if you do not use the dbr.button?

    3. I'll appreciate very much if it becomes and option or easy configuration.

    There will be a global option for this.

    --
    myDBR Team

  5. myDBR Team, Key Master

    1. For Total row, I made a simple but this works, I tried to limit my row number and show the issue. If you look at the picture, you see the Total (red rectangle) = SUM of some above and another cell (black rectangle).

    This is now fixes in latest build.

    3. I'll appreciate very much if it becomes and option or easy configuration.

    You can now turn off the tooltips using:

    $mydbr_defaults['crosstab']['tooltip'] = false;

    --
    myDBR Team

  6. spyhunter88, Member

    I really happy by your quick support and fix. Thanks very much!
    And I can due with the number 2, that's not really needed. If my client request, I can check it later.

    Also, I lost the header of popup while drag over the frame, if I drop there, I can make it move again.

  7. myDBR Team, Key Master

    Also, I lost the header of popup while drag over the frame, if I drop there, I can make it move again.

    Could you rephrase that? We did not quite understand what you were doing.

    --
    myDBR Team

  8. spyhunter88, Member

    You can check it by moving the popup inside the browser, when you drag the title (blue bar) over the top of browser, the title is hidden and if I drop the title in there, I can't move/close it.

    Thanks,

  9. myDBR Team, Key Master

    We'll take a look at it.

    --
    myDBR Team


Reply

You must log in to post.