Distinct Count Running Total

<p>I have a report that gets a distinct count of items per day.</p><p>DistinctCount(, , "daily")</p><p> I would like to create a running total of the daily count for a weekly grand total.</p><p>Thanks!</p>

<p>I&#39;ll take a stab at this - So I understand that the report is grouped by Day and looks like this:</p><p>GF1:    1/1/07   9</p> <p>GF1:    1/2/07   10</p> <p>GF1:    1/3/07   12</p> <p>GF1:    1/4/07   15</p> <p>GF1:    1/5/07   20</p><p> </p><p>The first thing I&#39;d try is to create a another group on your Date field, this time selecting the grouping option to be "For Each Week".  Take that group and move it so that it is Group1 and your current group is Group 2.... your structure will now look like this. </p><p>GH1:    1/1/07        < new &#39;week&#39; grouping&#39; > </p><p>    GF2:    1/1/07   9</p>  <p>    GF2:    1/2/07   10</p>  <p>    GF2:    1/3/07   12</p>  <p>    GF2:    1/4/07   15</p>  <p>    GF2:    1/5/07   20</p><p> Then I would copy the Sum field (distinct count) that you are using in Group 2 and put it in the Group 1 footer.  We could also create a formula to sum up all distinct counts per day, but a Distinct Count by week should accomplish what you are after.   Then in a seperate formula, you could divide the DistinctCount of orders (by week) by the DistinctCount of dates (by week) to get your daily average....</p><p>formula:</p><p>DistinctCount ({Orders.Order ID}, {Orders.Order Date}, "weekly") <br />/ <br />DistinctCount ({Orders.Order Date}, {Orders.Order Date}, "weekly") </p><p> </p><p>Hope that helps. </p>

Similar Messages

  • Distinct Count Measure Total in Two Dimensions

    I have a report that pulls data Site and then drills down to User for Content Usage for Six Months. These are separate dimensions in the cube. I have a DistinctContent Measure that pulls for both Site and User appropriately when I use separate queries but it
    is at the lowest level which is User. A sum of DistinctContent at the Site level is not appropriate - it needs to be the DistinctContent for the Site, and then drill down to the DistinctContent for User.
    Aggregate cannot be used because there are filters on the report, and they have to be there for various reasons.
    I've tried Lookup but it only looks up for one field. Multilookup doesn't work either. 
    I've tried a drill down to a subreport so that the initial dataset would be for Site, and then the subreport is for User and uses a different dataset, but you cannot merge the cells so
    that the subreport fits nicely under the top level.  
    How do I get the DistinctCount for the top level, Site?  
    I'm currently working on creating a cube that will only count the distinct content by site and then combine the two cubes as a virtual cube as a workaround but I'm not sure of the full implications of a virtual cube.   I feel like I'm missing something
    because this seems to be something that everyone must need at some point right?  
    I'm beating my head against a wall.  Thanks so much to anyone who can help out.  I'm hitting the deadline, and everyone is stressing out because I've been working on this one issue for days and I'm the everything IT person, so other things are slipping.
    Here is
     (the abbreviated version of) the query:
    SELECT
    NON EMPTY
    {[Measures].[Distinct Content]} ON COLUMNS
    ,NON EMPTY
    Filter
    ([Site].[by Type].[Site].ALLMEMBERS
    ,[Measures].[Views] > 0)*
    Filter
    ([User].[by Type].[User].ALLMEMBERS,
    [Measures].[Views] > 0
    [Time].[Month Year].[Month Year]
    DIMENSION PROPERTIES
    MEMBER_CAPTION
    ,MEMBER_UNIQUE_NAME
    ON ROWS
    FROM
    SELECT
    {[Content].[by Domain Type Item].[Type].&[3]&[1]&[Art]} ON COLUMNS
    FROM [Cntnt]
    Here is a picture of the report currently.  Unique Articles is the measure I'm having issues with and you can see at the top level is the site name, and below that the user.
    Thanks so much to anyone who can help me out.  I really, really appreciate it. 
    Julia

    Hi Julia,
    Thank you for your question. 
    I am trying to involve someone more familiar with this topic for a further look at this issue. Sometime delay might be expected from the job transferring. Your patience is greatly appreciated. 
    Thank you for your understanding and support.
    Regards,
    Charlie Liao
    TechNet Community Support

  • Running Total & Distinct Count Query

    Crystal 10.0.0.533 CR Professional
    Hope you can assist.
    I have a report listing deals signed, each deal has a corresponding category i.e. industry type, Accountant, Chiropractor, Financial Services, etc.
    I am undertaking a Distinct Count on these categories so that in the group footer it is showing number of different categories signed in a period (the report is grouped into different date periods). This is working OK.
    However, I need to EXCLUDE the category from this distinct count if the deal value is zero.
    I have tried using a formula to show a blank field if the value is zero, however it appears to be distinctly counting the blank as a category?
    Any assistance would be much appreciated.
    Tracy

    Deffinetly it will be less than what you expect for grand total. It is because when you are calculating distinct count for each group suppose
    Group A has categories A,B,C,D-->distinct count (4)
    Group B has C,D,E,F-->distinct count (4)
    but while calculating grand total then the distinct count will be
    A,B,C,D,E,F --> grand total (6) but not (8).
    In this case you need to use mannual running total like this
    whileprintingrecords;
    numbervar i;
    i:=i+{running total};
    place this in group footer and create another fomula like this
    whileprintingrecords;
    numbervar i;
    place this in report footer to get the correct grand total.
    Regards,
    Raghavendra

  • Count and Sum running total

    Can i sum and couunt running total in formula?.
    Please let me know.

    Hey, we can do count and sum functions in Running total.
    These functions are available in crystal reports for  summary fields.
    We can create  the running total based on the type of summary like Sum, count, max, min, distinct count, etc.
    We can do Evaluation for each record or on group or on each field  and also be done by writing a formula.
    We can  do count or sum by manual running total by writing a formula in the formula workshop.
    Based on our requirement we can use both functionalities.
    Please let me know  if you have any queries.
    Regards,
    Naveen.

  • Running Total Issue:  How to calculate counts excluding suppressed records

    Post Author: benny
    CA Forum: Formula
    Hello All:
    I have a current report that gives the total counts of work requests.   However, in my section expert, there are some records in the detail that are suppressed (if there isn't any backlog). The current running totals are counting all the records including the suppressed records. I think I need three formulas:1. Calculate the counts2. Calculate the counts excluding suppressed records3. Reseting the counts by group
    May I ask if someone can give me an example of what I should do?
    Thanks so much!
    Benny

    Post Author: benny
    CA Forum: Formula
    Bettername,
    Actually, I should have been more specific.  This report is actually a PM backlog report.  It displays all the work requests (PM) issued including the backlogged. There are 9 columns (including one called Backlog) for the different counts of the pm's based from the status codes (Issued, Material on Order, Completed, Cancelled, etc) of the work requests. The detail records of worke requests are grouped by shop and PM end date.  The running totals are calculated at the pm date group level (group footer#2). Then based from those at the shop group level (group footer#1) there is a grand total of counts of the running totals. The detail records and pm end date group header (group header #2) are suppressed.
    Now the foremen would like the report to just display all the backlogged PMs. Using the section expert, I suppressed all the PM issued that have no back log ({@ backlog = 0}) and just display the back logged pm's.  This is where I run into the running total issue.
    This is very involved report and I will use the column PM Issued as an example.  I can still use the same logic as you suggested?
    1. declaration formula:
    whileprintingrecords;numbervar pmissued := 0;
    2. Suppression formula that uses the variable:
    whileprintingrecords;
    numbervar pmissued;
    if ({@ backlog = 0}) then pmissued:= pmissed else pmissued:=pmissuedr+1
    3. Display formula:whileprintingrecords;
    numbervar pmissued;
    If this is the right track, then I can use the same example for the other columns. 
    Thanks so much.
    Benny

  • Displaying Distinct Count as Grand Total

    Hi -
    I have a requirement where i have to show the distinct count of Transaction Numbers at the bottom of the report as Grand Total. I created a dummy column with Fx as MAX(RCOUNT(1)) and used it in Narrative view and it is showing me the total rowcount whereas i want the distinct rowcount based on Transaction number column in my report.
    Any help is appreciated!
    Thanks
    R

    Instead of using a RCOUNT you can use the COUNT(DISTINCT <Transaction Number Column>) in your column formula
    This is an inbuilt function.
    Mark if it helps..

  • Running total in report footer returning inaccurate result

    Post Author: smarkta
    CA Forum: Formula
    I am writing a report that contains 3 groups.  I have created running totals for each group that are accurate by selecting the group to evaluate and reset on.  now I need to basically sum the results of the all the group running totals but have had no success.  any tips on how to do this would be greatly appreciated.
    Thanks

    Post Author: Charliy
    CA Forum: Formula
    Were you doing a Distinct Count?  Did you have a formula on the Running Total?  What is there about the Group Totals that make them different than the final total.

  • Running totals: Custom Reset via Formula? (VS 2005)

    Post Author: PunchngMrGrumpy
    CA Forum: .NET
    Hi All,I have attached a screenshot to help make up for my inability to describe the situation I'm dealing with here.I
    have three groups within a report that currently use distinct Running
    Totals fields that Reset at the group levels that I assigned. I am
    attempting to create a single Running Totals field for all 3 groups
    that will reset depending on which Group is being calculated at the
    moment so that I don't have to have 3 separate Running Totals object
    for each and every group. I'm not sure how to do this or write this
    formula as I'm new to Crystal Reports and am used to SQL Reporting
    Services where this evaluation is automatically done for you (I was
    spoiled I guess).For example, if the Running Totals field
    control is in Group #1, I want it to reset at Group #1, and Group#2 to
    reset at Group #2, etc without having to create a field for each group.So
    basically I'm attempting to use a formula to create a Reset point (view
    screenshot for detail) that is determined by which group the data is
    being calculated in. Is this possible? I realize that it is possible by
    simply creating a new running total object for each group and telling
    it to reset on change of group specified, but this seems completely
    redundant and overly time consuming for larger reports where there are
    multiple groups and a lot of Running totals fields.I'm developing the report with Crystal Reports within Visual Studio 2005 if that helps any.I
    don't know if you'll be able to see it, but I have a screenshot link to
    explain what I'm trying to do. http://www.codeguru.com/forum/attachment.php?attachmentid=19302Thanks!

    Hi Abhilash,
    Thanks for the code, but the totals aren't right still yet.
    Also, I just noticed my running total is not functioning properly.  Count be the reason for my delima.
    Any suggestions on how to get the running total to function properly?
    What I just noticed is:
    Date               Patient          Count
    7/9/13             Patient A       7
    8/8/13             Patient B       8
    8/8/13             Patient B       8
    8/8/13             Patient C       8
    8/8/13             Patient D       8
    8/15/13           Patient E       9
    Would I be better off to do a formula vs a running total?

  • Distinct Count Function-how to use properly

    Hello,
    I am new to using forums & have only been using Crystal since May of 2009, so i hope i do this correctly & provide the appropriate information.  i've looked for this answer in what's been posted but cannot find it.  Some things i've read I don't really understand.  I only know how to use the functions that are in the software, i don't know how to write them myself (i think that's when people have referred to SQL code or basic syntax)
    I have CR Professional, version 11.0.0.1282 (Crystal Reports XI).
    I work at a county health dept and we have a annual medicaid cost report,  I am linking Crystal to our EMR billing module.  i have my report sorted by insurance, ie medicaid, bcbs, abw, hpm etc.  and within each ins group i have the clients ID, DOS (date of service), procedure code, charge amt, ins pmt & patient pmt.  i have totaled the charges & pmts for each group-works fine.  i even have been able to create the formula to adj out the duplicate entries in the billing module (a service was entered wrong then adjusted out then re-entered correctly-without my formula crystal was pulling both these records and adding them to total charges.)
    Where my problem lies and what my question is:  I need to count encounters, an encounter is the visit, but each visit could have 2 or more procedure codes.   So this results in multiple lines on my report for one visit, which i want for the charges to add correctly, but it makes my visit count to high. So I read about the distinct count function, of which there are three listed & i'm having a hard time understanding the differences.  What i tried is: a distinct count of the acct ID-so the same acct ID's are only counted the one time.  But some clients see us more than once per year, meaning the acct ID is the same but the DOS is different.  For this client that would be 2 visits.  But crystal is counting this as 1.
    Saying what i want to do is this:  Count as 1 when the acct ID and DOS are the same.  I've tried using the different distinct counts but when i check my formula it always has errors.  So I'm sure my lack of knowledge is what's holding me up-i fully believe crystal can do this.
    Any help would be greatly appreciated.

    I create a dummy table, set up acc_id and DOS and Charge.
    Created a running total
    Summarized acc_id
    Type of summary Count
    Evaluated using a formula
         <> previous ()
    and reset on ACC_ID
    My groups were sorted by acc_id and date
    where there were multiple visits on the same DOS my count was 0
    where the dos changed it would count accordingly.
    You may need to use two Running totals to get the complete picture.

  • Distinct count that ignores NULL

    I am trying to do a distinct count of a field but I do not want any NULL rows to be counted.  Any ideas on how to accomplish this?
    I have created a formula field that returns a date from a different field if certain criteria are met.  If not, it returns  " ".  Now I need to get a distinct count of the dates.  I am not very experienced using Crystal and this has me stumped.

    You can also use a Running Total
    Select the field to be counted, select distinct count from summary list
    In the evaluate section check formula
    In formula editor
    not(isnull(yourfield))
    In the reset section check the appropriate level for resetting.
    Ian

  • Distinct count of Group header

    Hi Experts ,
    I have a crystal report where i have grouped on Business area and group header carries YTD Actuals Vs Target
    and in detail section  it carries  in different regions information ofthe business area.
    Now my concern is i need to count distinct business area in report header based YTD Actuals <= or > Target.
    Any Ideas!!!
    Thanks,
    Krishna

    I am not sure if I am understanding what you are asking correctly, but here is my take on it.
    You have a group that is identified as "Business Area"
    You have done a calculation to determine the YTD Actual for each Business Area which you have put into the Group footer or header
    Now you want at the report level a count of the business areas that have YTD actuals <= the Target, and a count of the business areas that have YTD actuals > the Target.
    If this is correct, could you use a running total?  In your field explorer pain, right click on Running Total and select New to open up the running total editor. In the summary section, select field to summarize on the field you used to define a business area; type of summary is "distinct count'; in the evaluate section, set up a formula to look for the YTD Actual <= to whatever the target was supposed to be; in the reset section, select never. 
    If this is not what you are trying to do, could you please reword your question?  For example, are you trying to reshow each business areas YTD totals compared to the target in your report header instead of a count?

  • Specified Order Grouping does not show if Distinct Count is Zero

    Post Author: Hieu
    CA Forum: General
    Hello,
    I'm using Crystal Reports XI R2 with SQL data source. I have a cross-tab report with grouping in specified order. It's a report of applicants applying to a college. The grouping is of various majors (degrees). The report summarizes (distinct counts) the number of applicants for the groups of majors. The problem is that if the count for a group of major is zero, then that Named Group does not appear at all in the cross-tab report. I want the Name Group to appear with the count of "0".
    I notice this same phenomenon with specified order grouping anywhere and not just in a cross-tab. I have tried changing "convert database/other null values to default" but nothing working yet.
    Any help will be most appreciated. Thanks.

    Post Author: synapsevampire
    CA Forum: General
    It's not a phenomenon, it's how databases and SQL works.
    You didn't get any rows back for those with a zero distinct count (otherwise the count would be 1 or more, right?), so Crystal doesn't show any data for those groups.
    So to display a zero for those that do not exist would reuire either advanced SQL, or manual summaries.
    One method for manual summaries is to use Running Totals. Select distinct count of the applicants and group by the majors, then in the evaluate use a formula place:
    {table.majors} = "Blah 1"
    Creating a seperate Running Total for every group and replacing "Blah 1" with the various majors.
    -kai

  • Charting Running Totals as Percentage

    I'm trying to show a running total as a percent of another running total in a chart.
    The report details have a unit ID (serial Number) and a flag indicating whether or not the unit went through rework.
    Running total 1 is a distinct count of unit ID, running total 2 is a distinct count of unit ID where the flag is No.
    I can make a chart that shows both counts, but running total 2 is always a count, and I'd like to show it as a percent of running total 1.
    I can create a formula that shows total2 as a percent of total 1 and put this in the group footer - but I can't chart on that formula.
    Is what I'm trying to do possible?
    Thanks
    Edited by: Doug McLauchlan on Mar 26, 2010 7:22 PM - Spelling

    I finally found an answer here:
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/f055d37d-2ddc-2c10-6ea3-d454e6f3bf94
    The technique involves building your charted values into strings and passing them to a sub-report to do the charting.
    I found I had to make several changes to way the report works in my situation - mainly because of grouping.

  • Distinct count of GRN's in Query PLD

    hi all,
    We have developed a daily grn report and designed report
    using  Query PLD.
    Report contains
    (grn no,date,vendor name,vendor ref no,item code,item
    description,quanity & line total)
    We want to display no of grn's(distinct count)
    @ repetitive area footer.
    Is there any function available in formula field to display
    distinct count of no. of grn's ? / It should done thru query.
    Thanks,
    with regards,
    A.Jeyakanthan

    it will be hard from PLD, instead u can have ur query like,
    SELECT 'Details', '   ',T0.Docnum, T0.CardName, .... FROM OPDN T0 WHERE Month( T0.DocDate ) = Month ('{%0]')
    Union
    SELECT 'Counts', count(T0.DocNum) as 'Doc(s) No', ' ', ' ', ... FROM OPDN T0 WHERE Month( T0.DocDate ) = Month ('{%0]')
    (Replace { with [ )
    Note ' ' is a gap in order to fill the other fields. in first query have given tht '  ' gap purposely so tht the display will not affect ur designing part
    union is used b'coz Count() fn is like aggregate, so wont allow further individual fields coming along with it.
    the 2nd query will occupy only one row, which by grouping u can separate and can hide from repetitive and take the value via formula field by writing that field's id to it into Footer Area.
    Regards,
    Dhana.
    Edited by: Dhanalakshmi C on Mar 5, 2008 1:31 PM

  • Report using Tabular Model and Measures based on Distinct Counts

    Hello,
    I am creating a report that should present something like this:
    YEAR-1 | MONTH-1 | MONTH-2 | MONTH-3... | YEAR | MONTH-1 | MONTH-2 | MONTH-3...
    My problem is that when designing the dataset to support this layout I drag the Year, Month and Distinct count Measure, but on the report when I want the value for the YEAR level I don't have it and I cannot sum the months value...
    What is the best aproach to solve this? Do I really have to go to advanced mode and customize my MDX or DAX? Can't basic users do something like this that seems so trivial and needed?
    Thank you
    Luis Simões

    Hi Luis,
    According to your description, you create a Reporting Services report using Analysis Service Tabular Model as the datasource, now what you want is sum the months value on year level, right?
    In your scenario, you can add the Month field to column group, add a parent group using Year Field and then add a Total on Month group. In this case, Reporting Services will sum the months value on Year level. I have tested it on my local environment, the
    screenshot below is for you reference.
    Reference:Lesson 6: Adding Grouping and Totals (Reporting Services)
    If this is not what you want, please describe your dataset structure, so that we can make further analysis.
    Regards,
    Charlie Liao
    TechNet Community Support

Maybe you are looking for

  • Java Web Start no longer works after Update 4 (2)

    There was another thread under this title for which a solution was found by correcting the designated "open with" app back to Java Web Start. My problem however is the Java Web Start simply crashes every time i try to open it since the installation o

  • Time Machine transfer to new Macbook Pro

    I bought a new Macbook Pro last week that I need to replace tomorrow due to slight case damage - I installed loads of applications such as Office 2008, transferred all photos etc and wondered if I do a Time Machine backup today before I return it tom

  • Utilities shortcut not working (shift+cmd+U)

    Hi all, I recently got a new external HD and backed everything up A-OK. Did a repair permissions and restart and all is well...except: when I use my keyboard shortcut to access my utilities (shiftcmdU) it no longer works. The keyboard shortcut for th

  • Finder continually reopens with an error message.

    I replaced my hard drive on a MacBook Pro and did a setore from Time Machine.  Now Finders keeps reopening, saying it unexpectedly quit while opening windows.  I can't get it to stop.  Ideas?

  • Selecting the tray or the roll as the paper source for printing

    my printing machine is a canon ipf 5100.With Aperture 2 it was easy to select "tray" or "roll" in the printer driver.With Aperture 3 it is impossible because their is no such option in the Aperture 3 driver.I have tried to download the last version o