Group on a formula question

Hi everyone!!
What I have so far is: 
NCM-Formula
If isnull {Billing_Data22.NCM Name} Then False
So I want to group on {@NCM-Formula}, and make sure that if {Billing_Data22.NCM Name} is a null value then no records show up on the report.
Advice..?
Thanks!

Abhilash,
I'm probably not describing this accurately.   I'm grouping on {Billing_Data22.NCM Name}.  This field has null values sometimes in the raw data in Access.  There are still records showing up for rows that do not have a value in {Billing_Data22.NCM Name}.  I'm trying to just show records when there are values for {Billing_Data22.NCM Name}.  So I'd like the report to only SELECT records when there is a value for {Billing_Data22.NCM Name}. 
Thanks!!
Rich

Similar Messages

  • Group by day - evaluation date formula question

    Hello,
    I am currently working on a report for on-call coverage.  I am having difficulty grouping by date and I'm hoping someone can help me.  Here is my situation.
    The on-call database has a coverage start date and coverage end date.
    Person A has a coverage start date of 9/1/2009 and a coverage end date of 10/5/2009.
    Person B has a coverage start date of 9/15/2009 and a coverage end date of 10/10/2009.
    The report I am trying to create needs to be grouped by the calendar day of coverage.  What I mean is, I need to be able to evaluate the coverage for a particular day.
    If I run the report for the evaluation date of 9/10/2009, it would show Person A, their coverage start date and coverage end date.
    If I run the report for the evaluation date of 9/20/2009, it would show Person A and Person B, with their respective coverage start and end dates.
    My question is, how do I create this evaluation date?
    Since this is a report for on-call coverage, I will also need to run this evaluation date into the future to confirm that there aren't any gaps in coverage.
    What I need to do is run this report for so the evaluation date would be for the next month.  So if I ran the report today, it would show me the on call coverage for November 2009, grouped by day.
    Any help you can provide would be greatly appreciated.

    You will need a calendar-type table, with one record per date.  Then, base your report on something like (MS SQL):
    select calendar.date, on-call.name
    from calendar, on-call
    where calendar.date between '{?lowDate}' and '{?highDate}'
    and calendar.date between on-call.start_date and on-call.end_date
    The first condition of the Where clause selects all of the dates that you want to report.  The second selects each person on-call for each of the dates from the calendar.
    You could also code a loop in the SQL Command, but calendar tables are really quite handy.  (For example, to indicate what dates are company holidays, where no on needs to be on call...)  I'd suggest setting one up if you don't have one available.
    HTH,
    Carl

  • Group Sort on formula field

    I am using CR Professional 11.5 on Windows XP/Progress platform.
    I have a formula field that calculates the GM% on the Employee Group Footer level and want to sort the employees in descending order by GM%.  I have gone in circles trying to calculate this field differently in order to be able to perform a Group Sort but this GM% cannot be summarized, which would allow me to use the Group Sort Expert.
    The fact that GM% is used in businesses world-wide each and every day makes this unbelievable that it should prove to be this difficult.  Is there something that I am missing as a newbie to CR design? 
    Any help provided is greatly appreciated!
    Marlene Human

    That's so awesome!  If only I knew how to use sql commands!  Everytime I try to create one it has errors that I dont' understand.  Do you know of a site for sql syntax that might help me to do this?  I have looked and can't find what I need to make this happen.
    So what I need to do is to use 'Formula Workshop' and create a new SQL Expression Field?  Using the formula above, how would this look in SQL?
    Thank you so much for your help...I am so grateful!!!  I have been working on this for months and keep hitting this snag.  I first started out using a cross-table and got confused because you can't summarize the GM% so I then changed the summary to 'weighted average of GM% with Tech/Rev' so that helped, but the Total per Employee has been keeping me stumped. 
    Thanks again.

  • Sort Group by a Formula

    Hello,
    I have a group called Part number with a few production jobs with in that group.  I also have a SPQ (Std Production Qty) for each Part number.  I have a formula called @AvgMQty that gets the average prodution qty. I have another formula called@diff that takes the ((SPQ-AvgMQty)/SPQ)*100 and I want to sort my report by this formula
    The Idea is to run the report for a given date range and show the Parts that have largest percent difference between the SPQ qty and what production is running.  I want to show the largest difference at the top of the report becasue the report can be very long.
    I've found a few other forums where people say this cannot be done becasue you can't sort a group using a "SUM" type of formula. 
    I would think what I'm doing is very common and someone knows how to do it!!!
    thanks for your help

    Give this a whirl - you might want to check it first by creating a new report, but rather than selecting tables, you'll want to use "Command" as the datasource once you've connected to your SQL Server.  As it is, this will select stuff between your previously used dates - but let's worry about that later.  For now, just check that the avg_prod_qty and sort_formula columns are giving you correct values...
    SELECT
    jomast.fpartno,
    jomast.fpartrev,
    inrtgc.fspq,
    joitem.fmqty,
    jomast.fddue_date,
    jomast.fjobno,
    jomast.fac,
    jomast.fstatus,
    jomast.fprodcl,
    averages.avg_prod_qty,
    (inrtgc.fspq - averages.avg_prod_qty)/inrtgc.fspq*100 as sort_formula
    FROM M2MData03.dbo.jomast jomast
    LEFT OUTER JOIN M2MData03.dbo.joitem joitem
         ON jomast.fjobno=joitem.fjobno
         AND jomast.fpartno=joitem.fpartno
         AND jomast.fpartrev=joitem.fpartrev
         AND jomast.fsono=joitem.fsono
    LEFT OUTER JOIN M2MData03.dbo.inrtgc inrtgc
         ON jomast.fpartno=inrtgc.fpartno
         AND jomast.fpartrev=inrtgc.fcpartrev
    left outer join --get the avg. production qty for a part number
         (select jomast.fpartno,
         avg(convert(float, joitem.fmqty)) as avg_prod_qty
         from jomast
         left outer join joitem
         ON jomast.fjobno=joitem.fjobno
         AND jomast.fpartno=joitem.fpartno
         AND jomast.fpartrev=joitem.fpartrev
         AND jomast.fsono=joitem.fsono
         group by jomast.fpartno) averages
    on averages.fpartno = jomast.fpartno
    WHERE (jomast.fddue_date>={ts '2008-06-01 00:00:00'}
    AND jomast.fddue_date<{ts '2009-06-01 00:00:01'})
    AND jomast.fac='Default'
    AND jomast.fjobno LIKE 'I%'
    AND jomast.fpartrev='NS'
    AND jomast.fstatus='CANCELLED'
    ORDER BY jomast.fprodcl, jomast.fpartno DESC

  • Formula Question: What is the formula to find how many duplicates I have in my table of data. e.g Sally, Sally, Sally, Tom, Tom, Ben. Answer by formula Sally 3, Tom 2, Ben 1

    Example of Data:
    A1
    2222222345
    2222222345
    2222222345
    2222222345
    2222222346
    2222222346
    2222222347
    2222222347
    2222222347
    2222222347
    2222222347
    2222222347
    Examplae of answer I would like the formula to provide:
    I also can not manually type coullum A I need the formula to auto full that aswel. As there is to much data.
    A2
    B2
    2222222345
    4
    2222222346
    1
    2222222347
    6

    Hi Jessica,
    Here's my take on it, using the sample data in your original post, and using the same solution with the names in your question.
    In the Data table, column A contains the list of numbers in your original post. I've rearranged them in random order to demonstrate that the order of entry does not matter for this method.
    Data::Column B contains the names in your question, each assigned to one of the numbers in the body of your post.
    Column C contains an index showing the first occurrence of each distinct number in Column A. This index is used to fill both columns in the Summary by Number table.
    Column D contains an index showing the first occurrence of each distinct name in Column Bt. This index is used to fill both columns in the Summary by Number table.
    Both formulas are the same, except for the columns referenced (highlighted in the second formula below).
    Formula: Data::C2: =IF(COUNTIF($A$2:A2,A2)=1,MAX(C$1:C1)+1,"")
    Formula: Data::D2: =IF(COUNTIF($B$2:B2,B2)=1,MAX(D$1:D1)+1,"")
    Both formulas require that row 1 be a Header Row, and that the contents of C1 (and D1) be Text, nothing, or a zero. Both formulas are filled to the end of their respective columns.
    Summary by Number contains two formulas.
    A2: =IF((ROW()-1)>MAX(Data :: $C),"",LOOKUP(ROW()-1,Data :: $C,Data :: $A))
    B2: =IF(LEN(A2)>0,COUNTIF(Data :: A,A2),"")
    Both are filled down to the end of their respective columns.
    The first formula checks if its row number minus 1 is greater than the maximum value in the index column. If that is TRUE, there are no more values to look up, and the formula returns an empty string (which appears 'blank'). If it is FALSE, the LOOKUP the value in Data::column A corresponding to the value of ROW()-1 in Data::column C.
    The second formula checks the LENgth of the entry in the column to its left. If the length is greater that 0 characters, there is a countable value in the cell, and the formula passes control to COUNTIF, which counts the number of times that value is found in Data::column A. If the length of the value in the cell to the left is zero, then the cell contains an empty string, and the formula passes control to the part after the last comma, which enters an empty string in the cell containing the formula.
    The formulas in Summary by Name are identical to these except for the (bolded) references. These are incremented to the right; C -> D, and A -> B to match the Data:: columns containing the names and the names index.
    Regards,
    Barry

  • Grouping with A formula issue

    I am grouping on a date that was calculated using the following formula :
    local stringvar d:= {TAGDTL.USER_DEF_TEXT_1}; //or database field
    numbervar y:= tonumber ( '20' & d[5 to 6]);
    numbervar m:= tonumber ( d[1 to 2] );
    numbervar dd:= tonumber ( d[3to 4] );
    date( y, m, dd)
    The date displays fine, however when I group on it, it appears that it ignores the date completely.
    The data in the detail shows up
    10/14/2008
    10/15/2008
    10/16/2008 etc
    however the group shows up with a completly different date.
    Group = 10/12/2008
    detail = 10/14/2008
    detail = 10/15/2008 etc....
    any ideas? Suggestions? help?
    Thanks,
    Jim

    Sorry guys, still get the same results...... I have tried the formula
    Whilereadingrecords;
    numbervar y:= tonumber("20" & Mid ({TAGDTL.USER_DEF_TEXT_1},5,2)); numbervar m:= tonumber(Mid ({TAGDTL.USER_DEF_TEXT_1},1,2)); numbervar dd:= tonumber(Mid ({TAGDTL.USER_DEF_TEXT_1},3,2));
    cdate( y, m, dd);
    and still get the same results...
    this is all done in a formula correct?
    Edited by: James Fulton on Oct 20, 2008 7:06 PM

  • Group by best practice question

    Consider this example:
    TABLE: SALES_DATA
    firm_id|sales_amt|d_date|d_data
    415|45|20090615|Lincoln Financial
    415|30|20090531|Lincoln AG
    416|10|20081005|AM General
    416|20|20080115|AM General Inc.
    I want the output to be grouped by firm_id with the sum of sales_amt and the d_data
    that corresponds to the latest d_date (i.e. max(d_date))
    Proposed query:
    select firm_id, sum(sales_amt) total_sales, substr(max(d_data), instr(max(d_data), '~') + 1) firm_name from (
    select firm_id, sales_amt, d_date || '~' || d_data from sales_data
    group by firm_id
    output is as expected:
    firm_id|total_sales|firm_name
    415|75|Lincoln Financial
    416|30|AM General
    I know this works but my QUESTION is: is there a better way to do this and is the above approach to concatenate columns when you want to aggregate multiple columns against any best practices.
    Thanks very much!

    Here's a way that uses analytics (I just like them):
    SQL> select * from sales_data;
                 FIRM_ID            SALES_AMT D_DATE               D_DATA
                     415                   45 15-JUN-2009 00:00:00 Lincoln Financial
                     415                   30 31-MAY-2009 00:00:00 Lincoln AG
                     416                   10 05-OCT-2008 00:00:00 AM General
                     416                   20 15-JAN-2008 00:00:00 AM General Inc.
    SQL> select firm_id, sum_amt, d_data
      2  from
      3  (
      4     select firm_id, d_data
      5           ,sum(sales_amt) over (partition by firm_id) sum_amt
      6           ,row_number() over (partition by firm_id order by d_date desc) rn
      7     from   sales_data
      8  )
      9  where rn = 1
    10  ;
                 FIRM_ID              SUM_AMT D_DATA
                     415                   75 Lincoln Financial
                     416                   30 AM General

  • Variable and Formulas Question

    Hi folks,
    I use BOXI r2 sp 4 and I have a general question re: variables and formulas in Webi reports.
    Billing Year Month and Cost of Service are standard time dimensions and measures that I use in my Webi reports and they were created at the semantic level.
    Normally, I create cross tab reports with the Billing Year Month along the horizontal axis and the Cost of Service in the Body (Business Unit or Department would be placed along the vertical axis).
    For some reason, when I use formulas/variables to modify the standard time dimensions (like changing Billing Year Month to Year), the values for the Cost of Service are returned incorrectly.
    Example.
    Semantic object: Billing Year Month = (yyyy-MM) returns correct values
    Report variable: Substr([Billing Year Month;1;4) returns incorrect values
    Can anyone please explain this problem?
    Thanks,
    Wannetta

    Hi John,
    The attribute of the Billing Year Month at the semantic level is a character type.
    After reading your response, I realize that I may not have been clear regarding the problem.
    The following formula does return the correct value in and of itself.
    >=Substr([Billing Year Month];1;4
    If I create a variable and then drag it onto my crosstab, it returns the correct value ONLY within the header.
    When I drag the cost of service measure onto the crosstab; the header values remain the same but values in the body either disappear or the change to reflect incorrect values.
    I thought one of the prime features of Webi was the ability of the Report Developer to create variables/formulas and use them in the headers to manipulate the semantic "measures" in the body (read: output) at the report level.
    Is this a matter of semantic design or does Webi not possess this capability?
    Or, is the issue entirely different?
    Thanks!
    W.

  • How to sort groups by derived formula

    My report contains two groups. First grouping is by department and second group is by pay_code (for example, OT, OT1, OT5 are overtime paycodes and RG, RG1, RG5 are regular hour paycodes). Each group at the department level contains a running total of overtime and regulartime wages (wage_amount is a database field for each record). I've inserted a formula in the department group footer: runningTotalOvertimeWages/runningTotalRegularTimeWages.
    There are about 70 department groups however I only want to show the 10 departments that have the highest overtime rate (result of formula described above.) I've read the docs for the Group Sort Expert however this option is not enabled because I'm using running totals and not summaries. Using a summary instead of a running total doesn't produce expected results (because second group is defined conditionally based on value of paycode.)
    Is there another approach I can use?

    Hi Patricia,
    I agree...the summary feature is has too many holes in it. 
    -What I mean is, can you add (sum...) the groups' overtime in a formula like: @sumOT  numbervar holdT:= holdT + table.ot.
    Running Total is good because it gives you some nice options and a place to set formulas.
    -If none of this is good for you, then I would go to the query
    (actually, this is the best solution anyway).
    Each db has it's own way of saying "Give me the top n of records". Here's a few ways of doing it:
    http://blogs.claritycon.com/blogs/satish_vemula/archive/2006/02/15/220.aspx...so get the top 10 groups in the query.
    ...then you can group by sum(ot) in the query.  This will give you the 10 groups and the sums (in whatever order you like).
    Please forgive me if I'm off track with what you're saying.  Not trying to frustate...your second posting did make things a little clearer.
    Hope this helps,
    The Panda
    I just wanted to add that in my "DB2" world, I might use a "With" statement
    to create a temp table with the original query, do all the calculations with the
    "with" table, and output everything preprocessed to the report.  This is great for charts and such where placement is so limiting in Crystal(...all the calculations are "below me", yet I want to show the chart "above me", etc.)
    Edited by: pandabear on Jun 23, 2008 3:37 PM

  • Grouping by specified order question

    I have CRXI. I have a group by specified order setup discarding others. In the page header I want to count all data, including the items I have discarded that don't meet the group parameters without displaying them. How would I accomplish this.
    Ralph

    You can statically add the where clause like this
    (select count(`Customer`.`Country`) from `Customer` where `Customer`.`Country`='USA')
    but unfortunately SQL Expressions doesn't support formula fields and parameter fields in it.
    Regards,
    Raghavendra

  • Custom Group using a formula

    I need to count records like -
    Formula A - "if {'Accounting Code 08 Value} < 1 then 0 else {?Date as Number} + {@Count Invoice #}
    "Date as Number" is just that" and
    "@Count Invoice" is "WhilePrintingRecords; NumberVar InvoiceCount:= InvoiceCount + 1"
    But I need to create a  Group so I can sum data by Formula A, currently it is not a selection in group expert even though it is on the report.  Any ideas???
    THANKS

    Hi Bill
    Based on what field you want to create a custom group is not clear.  If you want to create a group based on your {Accounting Code 08 Value} then you will have to write a formula and insert the formula as group and go in group options and select the specified order.
    Formula @Group 
    If {Accounting Code 08 Value} >= 1 and {Accounting Code 08 Value} <= 100
    Then "group 1"
    Else
    If {Accounting Code 08 Value} >= 101 and {Accounting Code 08 Value} <= 200
    Then "group 2"
    Else
    If {Accounting Code 08 Value} >= 201 and {Accounting Code 08 Value} <= 300
    Then "group 3"
    Else
    "Group Others"
    This will create group1,group2,group3 and Group Others groups.
    Thanks,
    Sastry

  • ASO OTL Formula Question

    I am attempting to create a scenario that presents lagged data (ie in march show the data for February). Sample of formula.
    CASE
    WHEN IS ([Jan],[Time].CurrentMember)
    THEN ( ([Dec],[2008 Actual]))
    WHEN IS ([Feb],[Time].CurrentMember)
    THEN ( ([Jan],[2009 Actual]))
    WHEN IS ([Mar],[Time].CurrentMember)
    THEN ( ([Feb],[2009 Actual]))
    WHEN IS ([Apr],[Time].CurrentMember)
    THEN ( ([Mar],[2009 Actual]))
    WHEN IS ([May],[Time].CurrentMember)
    THEN ( ([Apr],[2009 Actual]))
    WHEN IS ([Jun],[Time].CurrentMember)
    THEN ( ([May],[2009 Actual]))
    WHEN IS ([Jul],[Time].CurrentMember)
    THEN ( ([Jun],[2009 Actual]))
    WHEN IS ([Aug],[Time].CurrentMember)
    THEN ( ([Jul],[2009 Actual]))
    WHEN IS ([Sep],[Time].CurrentMember)
    THEN ( ([Aug],[2009 Actual]))
    WHEN IS ([Oct],[Time].CurrentMember)
    THEN ( ([Sep],[2009 Actual]))
    WHEN IS ([Nov],[Time].CurrentMember)
    THEN ( ([Oct],[2009 Actual]))
    WHEN IS ([Dec],[Time].CurrentMember)
    THEN ( ([Nov],[2009 Actual]))
    END

    Question 1: Is there a problem with what you have? Does it work? Is it slow? are you looking to do it better?
    Question 2: Do you have Year and Scenario in the Same dimension? If you do, you should change that and break them out, that is not a good design methodology
    If they were separate you could do something simple like
    CASE
    WHEN IS ([Time].CurrentMember, [Jan])
    THEN ([Actual], [Dec], [Year].CurrentMember.lag(1))
    ELSE ([Actual], [Time].CurrentMember.lag(1)
    END

  • DTP - Formula - Question

    Hello,
    I want to create a new formula in DTP (DSO to Cube).
    The new formula should fill new key figure. In long description the formula should look like:
    = summation ((If(.....
    The question is about "summation". The only area where I can change is in key figure directly.
    Question:
    Is it not possible in formula? Is it even necessary in formula?
    Thanks for input.

    .

  • Formula Question

    I am trying to determine First call Resolution for our technician tickets. So far without trying pull data from individual SQL tables etc to determin true FCR I am comparing two fields and want to count the number of tickets where the two fields are equal and report the numbers for each group that I have created. The fields are TASKS.OPENBY and TASKS.CLSDBY
    I tried doing a IF statement to cound the work order numbers when those are equal, but it does not report the number for each grouping, that the conditions are met for, when I add the first group to the count condition it reports back the same amount of total number of tickets for the group and I know there is a difference in the numbers. Thanks
    Ralph

    Basically I have a report that has all our TYPES, SUBTYPES, and CATEGORIES grouped together. Next to each header I have two columns, The first column is for the total number of tickets for each respective group type. This should be the complete today in the system with no filters.
    The second column I am aiming at is to determing how many tickets were resolved with the first call as determined by the technician that opened the ticket, being the same technician that closed the ticket and then reporting the counts. The third column would just be a percentage on FCR based on the two columns.
    I tried adding a command to the database expert so I could just run the query that compares the two, but once I add that to the report and count the numbers it then combine the SQL query so that the total number of tickets formula count is the same count as the FCR formula. Here is the SQL query that is created:
    Trackit
    use trackit8_data
    select WO_NUM, CLSDBY, OPENBY, TYPE, WOTYPE2, WOTYPE3
    from dbo.tasks
    where openby=clsdby
    EXTERNAL JOIN Command.WO_NUM={?Trackit: TASKS.WO_NUM}
    Trackit
    SELECT "TASKS"."TYPE", "TASKS"."WOTYPE2", "TASKS"."WOTYPE3", "TASKS"."WO_NUM"
    FROM   "TRACKIT8_DATA"."dbo"."TASKS" "TASKS"
    WHERE  "TASKS"."WO_NUM"={?Trackit: Command.WO_NUM}
    ORDER BY "TASKS"."TYPE", "TASKS"."WOTYPE2", "TASKS"."WOTYPE3"
    Thanks
    Ralph

  • Formula question - Alphabetical to numerical

    I am running a pinewood derby competition for my boys group. I have a numbers doc where I keep track of who paid, handed in their car, etc.  It is setup alphabetically by last night.
    I also have a column for the assigned car number as they are handed in.
    I can't for the life of me figure out a formula that will insert the boys name in another portion of the form as I assigm them a numerical numer.
    Can anyone assist?

    This might be what you want but not 100% certain:
    I used 2 tables:
    1) the one on the left "Status" and
    2) the one on the right "Races" (for lack of a better name)
    Table two is where the "Action" is:
    B2=IFERROR(VLOOKUP(A2, Status :: A:D, 2, 0), "")
    select B2, click and hold the small circle at the bottom right of the highlighted cell, then drag down as needed.  Put car numbers in the 1st column and this will put the boys name in the 2nd column

Maybe you are looking for