Percentage/sum issues

(3 posts) (2 voices)

Tags:

No tags yet.

  1. elb98rm, Member

    I'm starting to make some graphs and I'm looking at having a percentage field in each of the rows.

    I cant see anywhere on how to select items *not on the main chart* to do this in the documentation...

    For example:

    Item : Total : Percentage
    1 20* 40%
    2 20 40%
    3 10 20%
    --------------------------
    50* 100%

    How do I get the reference for the starred items (20, 50)?
    I have the following, but as you can see - there's one variable "abstotal" (which is 50) I need to reference somehow.

    select 'dbr.sum', 'Total';
    select 'dbr.calc', 'percent', '[Total]/[abstotal]*100';
    select v.contract_status as 'Contract_status',
    count(*) as 'Total'
    ,null as '%[percent]'

    Many thanks
    Rick

  2. elb98rm, Member

    well... that fake-table formatted a lot better in the reply box haha. Reply if you're unsure of what I mean. :)

  3. myDBR Team, Key Master

    Calculate first the abstotal from the data and put it into a variable. Then you can use it in the actual query.

    --
    myDBR Team


Reply

You must log in to post.