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.

Similar Messages

  • How to use session variable in JSP function  & How to use both JSP  Servlet

    Hi,
    I am new to JSP and servlets
    Still I am devloping a website in JSP. I am not mixing JSP with servlets, but I do create Java files for bean, logic and database works.
    I try to keep the hard coding part out of JSP.
    I dont how to use both JSP and Servlets in combination.
    Hence If needed I write some functions in JSP.
    but it gives me error
    +<%! public void abc()+
    +{+
    int intUserId = Integer.valueOf((Integer) session.getAttribute("MySession_UserID"));
    +}+
    +%>+
    Saying cannot find symbol session
    1) So can u please tell how can I access session variables within JSP function
    2) And also give me some links/tutorials about useing both JSP and Servlets in combination.
    Thanks
    Venkat

    The application architecture when you use Servlets and JSP in a standard MVC pattern is explained here (under the heading "Integrating Servlets and JSP Pages") and here ...

  • Why is the Tick Count function slow when used with a .dll but fine with normal lab view code?

    when using the Tick Count millisecond timer with a .dll I've written in C, I'm getting some odd timing issues.
    When I code the function I want (I'll explain it below in case it helps) in LV and run it as a subVI, feeding it the Tick count as an argument, the function runs quickly, but not quite as quickly as I would like. When I feed this same subVI just an integer constant rather than the Tick Count, it takes about the same amount of time, maybe a tiny bit more on average.
    When I bring in my function from a .dll, however, I start to run into problems. When I feed my function an integer constant, it is much faster than my subVI written in LV. When I feel my .dll the Tick Count, however, it slows down tremendously. I'm including a table with the times below:
                 |  Clock   |   Constant   |
    SubVi:   | 450ms  |  465ms       |
    .dll         | 4900ms|  75ms         |
    This is running the function 100,000 times. The function basically shifts the contents of a 2-dimensional array one place. For this function, it probably won't be a huge deal for me, but I plan on moving some of my other code out of LV and into C to speed it up, so I'd really like to figure this out.
    Thanks,
    Aaron

    Hi Aaron,
    Thanks for posting the code -- that made things a lot clearer for me. I believe I know what's going on here, and the good news is that it's easy to correct! (You shouldn't apologize for this though, as even an experienced LabVIEW programmer could run into a similar situation.) Let me explain...
    When you set your Call Library Function Node to run in the UI Thread you're telling LabVIEW that your DLL is not Thread-safe -- this means that under no circumstances should the DLL be called from more than one place at a time. Since LabVIEW itself is inherently multithreaded the way to work with a "thread-unsafe" DLL is to run it in a dedicated thread -- in this case, the UI thread. This safety comes at a price, however, as your program will have to constantly thread-swap to call the DLL and then execute block diagram code. This thread-swapping can come with a performance hit, which is what you're seeing in your application.
    The reason your "MSTick fine behavior.vi" works is that it isn't swapping threads with each iteration of the for loop -- same with the "MSTick bad behavior.vi" without the Tick Count function. When you introduce the Tick Count Function in the for loop, LabVIEW now has to swap threads every single iteration -- this is where your performance issues originate. In fact, you could reproduce the same behavior with any function (not just TIck Count) or any DLL. You could even make your "MSTick fine behavior.vi" misbehave by placing a control property node in the for loop. (Property nodes are also executed in the UI thread).
    So what's the solution? If your DLL is thread-safe, configure the call library function node to be "reentrant." You should see a pretty drastic reduction in the amount of time it takes your code to execute. In general, you can tell if your DLL is thread-safe when:
    The code is thread safe when it does not store any global data, such as global variables, files on disk, and so on.
    The code is thread safe when it does not access any hardware. In other words, the code does not contain register-level programming.
    The code is thread safe when it does not make any calls to any functions, shared libraries, or drivers that are not thread safe.
    The code is thread safe when it uses semaphores or mutexes to protect access to global resources.
    The code is thread safe when it is called by only one non-reentrant VI.
    There are also a few documents on the website that you may want to take a look at, if you want some more details on this:
    Configuring the Call Library Function Node
    An Overview of Accessing DLLs or Shared Libraries from LabVIEW
    VI Execution Speed
    I hope this helps clear-up some confusion -- best of luck with your application!
    Charlie S.
    Visit ni.com/gettingstarted for step-by-step help in setting up your system

  • New Advanced tab for Calibration-how to use properly?

    Dear Adobe and Lens profilers,
    I have just used the newest Lens Profile version and noticed the new "Advanced" tab on the right beside "Calibration".  There are lots of choices for rectilinear, fisheye, distortion, etc.  I need information on how to use the advanced tab - I do not see updates to the user guides that are available that address this new tab. For example, there are "one parameter radial distortion" up to five parameters for various items, there is a sensor pixel shape choice - could someone from Adobe please address and explain these choices and how to properly set them for use,(including the vignette model and principal point choices, and all of these).
    Thank you,
    Debra

    Hi Debra, in general, the higher the number of parameters, the better the potential for correction (especially for full frame cameras). For example, the three-parameter radial model in some cases will do a better job than the two-parameter radial model. I have not found cases yet where the 5 parameter (radial & tangential) model is helpful. As you can see, the default option is Auto which means Lens Profile Creator does an internal comparison of which model works best for your provided measurement data, and picks the appropriate model automatically. (This is largely why it is not necessary to fiddle with the Advanced settings.)
    When you find cases where Lens Profile Creator is not building a satisfactory profile, my experience has been that the common issues cannot actually be addressed by using the Advanced settings. For example, if the profile is slightly overcorrecting for vignetting, changing the Vignette model parameters in the Advanced section often does not help. (This does not mean that future versions of ALPC won't provide other ways to deal with it. It just means that for now ALPC does not provide a direct means by which to tweak a profile that is slightly off.) If you are using Camera Raw or Lightroom, my suggestion is to use the "Correction Amount" sliders beneath the profile selection to adjust the correction. In the vignette overcorrection case, instead of using the default value of 100, dial it back to 80 or 60 (as an example)

  • Counter function : How works the Set attribute function

    Hi,
    I use Labview and a 6713 DAQ
    I want to use the "set attribute vi" but I don't exactly what means the "attribute value number" and the attribute value type" in that vi
    >Where can I find some data about that?
    >What is the relation between the internal clock frequency and the attribute value number if I generate a pulse train ?
    >How can I configure the frequency of my DAQ ? ( I can use 20MHz or 100KHz )
    Any help is greatly appreciated
    Renaud

    Renaud,
    You can read the on-line help for the Set Attribute VI by right-clicking over the VI and selecting "Help." The help will describe each of those parameters. In addition, you can search through counter examples for your 6713 by selecting from the menu bar Help>>Search Examples>>I/O Interfaces>>Counters. Any example that demonstrates the functionality of the DAQ-STC counter will work for your board. In addition, you will find examples on pulse train generation.
    Hope this helps.
    Regards,
    Erin

  • Time and date function, how to use?

    Hello everyone,
    I want to know that how can we make use of these two system functions SY-TIMLO, SY-DATUM ?
    What should i write in data? pbo? pai?
    Should i write something like this in data?
    DATA: Ok_date TYPE SY-DATUM.
    DATA: Ok_time TYPE SY-TIMLO.
    What should i write in pbo and pai and should i need to make changes in screen elements? do i need to create one?
    Please guide and explain with an example. Thanks a lot for writing back.
    Regards,
    Lucky
    Moderator message - Please ask a specific question - post locked
    Edited by: Rob Burbank on Aug 4, 2009 12:14 PM

    Hi,
    create two variables in the top include..
    data :P_date type Sy-datum default sy-datum,
    p_time type sy-uzeit default sy-uzeit.
    Next go to screen and enter table syst...
    and select datum and uzeit and drag to screen..
    and rename the field to p_date for syst-date and p_time for syst-uzeit.
    Prabhudas

  • U430 - How to use properly with battery?

    Is it o.k to conect the charger to the computer constantly?
    I mean, there is switch that when the battery full load it charge directly the computer?
    I ask because most of the time my computer on my table and I don't know if it's good to conect it to the charger constantly or everytime it is full disconect the charger.
    Thank's!

    A laptop computer battery should last between two and four years, or around 1,000 full charges, i have mine always connect to power when at home and the battery now holds about 50% charge it is 7 years old and well exceeded my expectations on life of the battery
    now days it all about storing the battery
    Fully charge new batteries before use.
    A laptop battery’s health deteriorates the more you charge and discharge it, running it from a power source will make your battery remain in a state of charge/recharge. Instead, when your battery gets to near 100% charged, unplug it from the power and plug it in again when it is low.
    Heat will dramatically affect battery life for both batteries in your laptop and spare batteries you have stored. Keep spare batteries in a cool place and try to make sure that your laptop has plenty of ventilation so that the battery does not get too warm.
    Keeping the laptop cool will also reduce the need for your fan to run which also uses more battery power.
    If you are using your laptop as a desktop replacement, consider removing the battery and just running the laptop directly from the power source.
    Store spare batteries or if you not going to use it for a week or so with approximately 40% charge, batteries even when stored will discharge over time.
    Adding more RAM to your laptop will actually decrease battery consumption as RAM will be used rather than your hard drive to run resource intensive processes.
    Your hard drive is a mechanical device and is a significant power hog.
    Try to minimize CD/DVD drive use. As with your hard drive, your optical drives are a mechanical device that will consume a lot of power when in use.
    hope this clears a few things up
    Thx dave
    yoga 2, lenovo b540
    3 custom gaming pc systems

  • How do I solve this distinct count problem?

    Hello experts,
      So, I have an OBI report (table view).  I needed to get the percentage difference btn 2 columns, I did. Then I had to summarize difference in 4 buckets (0-15, 16-30, 31-50, >50%); I did (case statement). NOW,  I need to summarize(distinct count) the above buckets based on Store numbers for each day.
    Basically, if the difference is btn(0-5%) and I have 5 stores then I need to see 5 stores separately. The problem I am having when I do the distinct count instead of having separate counts for each bucket I am getting the total.  I see the buckets summarized, but the store column is showing the total number of all(we have about 700 stores) instead of breaking down the count for each bucket.  In the stores column I am using the distinct count function, I don't know if the problem is here or the case statement for buckets. I don't know either OBIEE is able to do what I trying to do, since I have yet to do this kind of function.  I have gotten few leads on my first post,  so far none of them have worked.
    As always, your insights are highly appreciated,

    Instead of using Distinct Count in Aggregation Rule,Try using in Column Formula.
    Let me know if u need any help on this.
    Thanks,

  • Distinct count using lookup table

    How can I get a distinct count of column values using a different table?
    Let's say I want to get a distinct count of all "company_name" records in table "emp" that corespond (match) with "lookup" table, "state" category.
    What I want is to find counts for all companies that have a value of "california" in the "state" column of the "lookup" Table. I want the output to look like:
    Sears 17
    Pennys 22
    Marshalls 6
    Macys 9
    I want the result to show me the company names dynamically as I don't know what they are, just that they are part of the "state" group in the lookup Table. Does this make sense?
    M

    Mark,
    In the future you might consider creating test cases for us to work with. Something similar to the following where sample data is created for each table as the union all of multiple select statementsselect 'INIT_ASSESS' lookup_type
         , 1 lookup_value
         , 'Initial Assessment' lookup_value_desc
      from dual union all
    select 'JOB_REF', 2, 'Job Reference' from dual union all
    select 'SPEC_STA', 3, 'SPEC STA' from dual;
    select 'INIT_ASSESS' rfs_category
         , 1 val
      from dual union all
    select 'JOB_REF', 1 from dual union all
    select 'JOB_REF', 1 from dual union all
    select 'SPEC_STA', null from dual;Then we can either take your select statements and make them the source of a CTAS (create table as) statementcreate table lookup as
    select 'INIT_ASSESS' lookup_type
         , 1 lookup_value
         , 'Initial Assessment' lookup_value_desc
      from dual union all
    select 'JOB_REF', 2, 'Job Reference' from dual union all
    select 'SPEC_STA', 3, 'SPEC STA' from dual;, or include them as subfactored queries by using the with statement:with lookup as (
    select 'INIT_ASSESS' lookup_type
         , 1 lookup_value
         , 'Initial Assessment' lookup_value_desc
      from dual union all
    select 'JOB_REF', 2, 'Job Reference' from dual union all
    select 'SPEC_STA', 3, 'SPEC STA' from dual
    ), RFS as (
    select 'INIT_ASSESS' rfs_category
         , 1 val
      from dual union all
    select 'JOB_REF', 1 from dual union all
    select 'JOB_REF', 1 from dual union all
    select 'SPEC_STA', null from dual
    select lookup_value_desc, count_all, count_val, dist_val
      from lookup
      join (select rfs_category
                 , count(*) count_all
                 , count(val) count_val
                 , count(distinct val) dist_val
              from RFS group by rfs_category)
        on rfs_category = lookup_type;Edited by: Sentinel on Nov 17, 2008 3:38 PM

  • Use Variance for Distinct Count of Group Results

    Post Author: Judith
    CA Forum: Crystal Reports
    Hi there,
    I am new to CR. I am using CR 2008. I am stuck (every two minutes) and it would be great, if you could help me with this one:
    I have a list of people who are talking to each other:A to B, B to A, C to D, D to A etc. Then I wanted to see, who has most friends and I have created Groups to have a Distinct Count on how many people are talking to A, and to B, and to C etc. that worked fine. What I would like to do is to find out is who of these has most people they are talking to. Or even better, what is the variance of the resulting subtotals. Simply using Variance or Maximum doesn't seem to work on the DistinctCount Summary.
    I would very much appreciate any help on this.
    Judith

    Post Author: Jagan
    CA Forum: Crystal Reports
    I understand the issue, I don't understand why you think DistinctCount at two different levels should total up. Consider this sample data:Facility, EmployeeA, 1A, 2B, 1B, 3
    Facility A's distinct count => 2Facility B's distinct count => 2Report's distinct count => 3
    Use DistinctCount() at the group level and create a formula to sum these counts yourself and print that in the report footer.

  • DAX query to calculate distinct count respect to a column after a Filter function - SSAS 2012 Tabular

    Hi,
    I'm trying to build the dax query to determine the distinct count for a column returned by the application of a Filter function.
    evaluate(
    row("counter",
    countrows(
    filter(order_summary,
    year(order_summary[change_date]) = 2013) )
    I need to count the distinct values for an id returned by the Filter function.
    Any helps, please? Thanks

    Hi pscorca,
    According to your description, you want to calculate the distinct values for records where change_date is 2013. Right?
    In this scenario, we can use the DISTINCT() function within COUNTROWS(). Please try the expression below:
    =calculate(
    countrows(distinct(order_summary[column])),
    Filter('order_summary', year(order_summary[change_date])=2013)
    Reference:
    Distinct Count Measure in PowerPivot using DAX
    Related Distinct Count
    Best Regards,
    Simon Hou
    TechNet Community Support

  • How to use Partner function in Purchase transactions(Purchase cycle)

    Hi,
    My issue is related to partner function i have defined the following customize setting .
    1) Defined partner role
    2)Defined Permissible Partner Roles per Account Group
    3)Defined Partner Schemas
    4)Assigned Partner Schemas to Account Groups
    5)Assigned Partner Schemas to Document Types
    6)created Partner role for vendor in vendor master given defrent vendor code for one partner type i.e given different vendor number to Invoice party (IP)
    7) crated PO and GR during IR when i click Detail tab there is Inv. Party Field which shows all the vendor master  i want only my Partner type there. how to archive this.
    actually my question is after define the Partner function how to use them in MIRO or MIGO i am not able to understand if some one know pls reply
    regards,
    Ashish Vats

    Hi
    The use of Standard Parner functions are as follows:
    1. Ordering Address (OA): The PO will be sent this vendor and not the main vendor.
    2. Goods Supplier (WL): In case of return deliveries, Goods will be returned to thsi vendor's address
    3. Invoicing party (RS): The payment will be made to this vendor.
    Hope this clarifies.
    Thansk

  • How to use call back function ?

    i have MlEditmanager class which extends xyzManager class. I also want to extend Eventdispatcher .. but it is not possible to extend more than one class ...
    so the work around can be to create call back function. private var xyz:Function; --> how to use this syntax?
    Can someone help me how to achieve this?
    Urgent pls.

    Hi
    check out this link
    http://rushmeflex.blogspot.com/2010/09/cairngorm-2-view-notification.html
    Though this is not your requirement, however in the source code callback functions are used. You can get clue from that.
    Hope this helps
    Rush-me

  • The distinct count issue?

    Hello experts,
      So, I have an OBI report (table view).  I needed to get the percentage difference btn 2 columns, I did. Then I had to summarize  difference in 4 buckets (0-15, 16-30, 31-50, >50%); I did (case statement). NOW,  I need to summarize(distinct count) the above buckets based on Store numbers for each day.
    Basically, if the difference is btn(0-5%) and I have 5 stores then I need to see 5 stores separately. The problem I am having when I do the distinct count instead of having the counts separately for each bucket I am getting the total.  I see the buckets summarized, but the store column is showing the total number of all(we have about 700 stores) instead of breaking down the count for each bucket.  In the stores column I am using the distinct count function, I don't know if the problem is here or the case statement.
    I know its Friday, still I believe there is someone who might have an idea on my dilemma.
    As always, your insights are highly appreciated,

    Header 1
    Header 2
    Header 3
    Header 4
    Header 5
    Header 6
    Date
    Store Count
    Sales
    Todate Sales
    Difference %
    Difference buckets
    03/24/2013
    698
    716,374
    717,011
    -0%
    0-15%
    03/25/2013
    698
    583,335
    583,793
    -0%
    0-15%
    03/26/2013
    698
    220,640
    220,886
    -0%
    0-15%
    03/27/2013
    698
    236,803
    188,150
    215
    11-30%
    Header 8
    Srini,
      I am still not good at using OTN tables, but above is what I am talking about. Basically, The store count should not show the total count of all stores, instead it should show only distinct count that within the percentage bucket. As u can see it gives me the total, I made sure the aggregate rule isn't sum. By the way, could the problem be the case statement not the store column..
    I also tried bucket and store only, still it shows the sum of all stores and not just distinct.
    any idea

  • Counter function

    Hi,
    What is the counter function & how it will use.
    With Thanks & Regards
    Koteswara Rao

    Hi,
    As explaine above and below link
    http://help.sap.com/saphelp_nw2004s/helpdata/en/43/c4cdfc334824478090739c04c4a249/content.htm
    <b>O = Number of calls for this target-field mapping where you specify the initial value and the increment of the counter in the function properties</b>
    To maintain the no of calls for target field ..we can use this function..
    But this will be only one instance , ihope... the value may not be persisted..
    , if your process restarts or J2ee restarts or XI restarts then..this counter value may not be continue..
    Regards
    Chilla..

Maybe you are looking for

  • ASKB - Purpose

    Hi Though I have myself handled it in the past, I could not recollect due to huge time gap.... I also browsed through various posts of the forum, but could not recollect my understanding yet... 1. (Is this understanding correct??) As far as I remembe

  • I need to reinstall my mac OSX to my macbook but it will not load up past the "safemode" login

    I need to reinstall my macbook, it has a very difficult time loading up to the "safemode" login (I have to hold down the shift button as I start the computer up) then none of my icons show up after logging in... I don't know what is wrong with it! I

  • I have add erail in my addons but its not working

    ''duplicate of - https://support.mozilla.org/en-US/questions/974396 - locking'' i have add erail in my addons but its not working

  • Quicktime window spills to second monitor

    Hi -- I have QT Pro 7.6.5 running on a Windows XP Pro SP3 PC with dual monitors. Whenever QT opens, it creates its window about 1 to 1.5 inches down and 1 to 1.5 incles to the right of the main (left) display's upper left corner. When it plays widesc

  • HUB 4. INFINITY VERSION OR WHAT ?

    HAVING JUST MOVED HOUSE AND BEING ON INFINITY 2 TARIFF , I REQUESTED AN UPGRADE  FROM HUB 3 TO HUB 4 INFINITY VERSION.   WHAT I  ACTUALLY GOT WAS THE STANDARD HUB 4 IN A REFURBISHED  SWAP BOX,   I WAS THEN TOLD BY INDIA THERE IS ONLY ONE VERSION OF H