dbr.summary

(8 posts) (3 voices)

Tags:

No tags yet.

  1. elb98rm, Member

    Is it possible to specify different levels of summary for different areas of summary?

    By this I mean:

    Data

    1 | 1 | 1 | 2 | 3
    1 | 1 | 1 | 2 | 3
    1 | 1 | 1 | 2 | 3
    -----------------
    3 | 3 | 3 | 6 | 9

    1 | 1 | 1 | 2 | 3
    1 | 1 | 1 | 2 | 3
    1 | 1 | 1 | 2 | 3
    -----------------
    3 | 3 | 3 | 6 | 9

    1 | 1 | 1 | 2 | 3
    1 | 1 | 1 | 2 | 3
    1 | 1 | 1 | 2 | 3
    -----------------
    3 | 3 | 3 | 6 | 9

    max 1 | max 1 | max 1 | max 2 | max 3

    ^
    The above table shows raw data, sums them for each group, but on the "total" only shows a "max" value.

    i.e - can you specify different summaries (and turn off/on) for each limit_summary_level
    So - sum @ level 2, nothing for level 1, max for level 0 etc etc..

    Cheers
    Rick

  2. myDBR Team, Key Master

    Rick,
    there is no separate command for that. You can, however, do it quite easily with some JavaScript by simply removing the results you do not need.

    select 'dbr.hdr', 'A';
    select 'dbr.sum', 'B', 'C', 'D', 'E', 'F';
    select 'dbr.max', 'B', 'C', 'D', 'E', 'F'; select A, B, C, D, E, F
    from mydata
    order by A; select 'dbr.javascript', "$('.summary_level0 div:nth-child(1), .summary_level1 div:nth-child(2)').remove();", 'onload';

    --
    myDBR Team

  3. elb98rm, Member

    I'd suggest you add this: it's a good feature to have in future.

    In the interim: this is a great hack! :)
    Thanks

  4. cris, Member

    I use similar code in one of my reports. The javascript example above now removes the entire row instead of just the targeted cells. Was this always the intended outcome, or did something change? How can I remove just some of the cells from a header summary row instead of the whole row?

    select 'dbr.hdr', 'A'; select 'dbr.sum', 'B', 'C', 'D', 'E', 'F'; select 'dbr.max', 'B', 'C', 'D', 'E', 'F';

    select 1 as 'A', 2 as 'B',2 as 'C',3 as 'D',3 as 'E',4 as 'F' #from mydata order by A;

    select 'dbr.javascript', "$('.summary_level0 div:nth-child(1), .summary_level1 div:nth-child(2)').remove();", 'onload';

    Thank you for your help.

  5. myDBR Team, Key Master

    What is the "entire row" that gets deleted the summart levels on each A breakpoint or the final summary row? What are the cells you wish to remove?

    --
    myDBR Team

  6. cris, Member

    Here is the output I see when I comment out the javascript in the code above:

    A B C D E F
    1 2 2 3 3 4
    1 2 2 3 3 4
    max 2 max 2 max 3 max 3 max 4
    2 2 3 3 4
    max 2 max 2 max 3 max 3 max 4

    Hope that lays out correctly when I post. I'm trying to remove the 'max 2' and 'max 2' from columns B and C in the header summary row (not the bottom row, but the max summary for '1'), but leave the 'max 3', 'max 3' and 'max 4' showing from columns D, E, and F.

    I have played with the browser inspector trying to find the proper cell elements and spent 30 minutes with ChatGPT, but can't figure it out.

    Thanks for the assistance,
    Cris

  7. myDBR Team, Key Master

    You can use:

    $('.summary_level1:is(:nth-child(2), :nth-child(3)) div.max').remove()

    The total summary level is 'summary_level1' and the first level above that is 'summary_level1'. From that you select the 2nd the 3rd column and from those TD cells, you select the DIVs with 'max'-class.

    --
    myDBR Team

  8. cris, Member

    Awesome! Thank you so much.


Reply

You must log in to post.