Disable summary auto by dbr.calc

(3 posts) (2 voices)

Tags:

No tags yet.

  1. spyhunter88, Member

    Hi myDBR Team,

    I use formula to display information instead of value, but it combines of some value columns and all these're defined with dbr.sum. For example:

    select 'dbr.sum', 'Value1', 'Value2'; select 'dbr.calc', '[Action]', '[Value1]>[Value2]?\'YES\':\'NO\'';

    select Value1, Value2, null as 'Action[Action]' from Some_Table;

    Now, the summary text in Action column will be YES or NO base on sum of Value1 and Value2. But it doesn't make sense at all. So, how to I disable the summary value in Action column?

    Thanks,

  2. myDBR Team, Key Master

    The dbr.calc command populates the summary row by default. If the sum(Value1) > sum(Value2) then the summary row for Action is 'Yes' as stated in the formula.

    You can use normal MySQL IF command for Action-column

    select Value1, Value2, null as 'Action[Action]',  if (Value1>Value2, 'YES', 'NO')
    from ...

    If you want to use dbr.calc, you can use a helper column:

    select 'dbr.sum', 'Value1', 'Value2';
    select 'dbr.hidecolumn', 'v2';
    select 'dbr.calc', '[Action]', '[v2]!="" ? ([Value1]>[Value2] ? "YES": "NO") : ""'; select Value1, Value2, null as 'Action[Action]', Value2 as 'v2'
    from ...

    --
    myDBR Team

  3. spyhunter88, Member

    Thanks, I'll use the 2nd method, my formula is so complex and can not use directly in SQL statement.


Reply

You must log in to post.