Alpha Video Training
Results 1 to 6 of 6

Thread: How to add a unique filter to a summary operation?

  1. #1
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,663

    Default How to add a unique filter to a summary operation?

    I have a table of appointments queried for a given month where the same client may have visited more than once. I need to get a summarized count of various statistics about the client and the details of the visit, but in particular the ethnicity of the client. I created a set to base the summary operation on and am getting most of what I need except the count is based on all visits and not just for the unique client id. Eg. in February there were 325 total visits for the month by 218 unique clients. My ethnicity breakdown should total 218 and not 325 - which it is doing now.

    What do I need to do to achieve this goal in which the end purpose is for a report?
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

  2. #2
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: How to add a unique filter to a summary operation?

    Something like

    line_count(table.external_record_content_get("appointments","clientid","ethnicity_field","report_date_query_expression .and. unique_key_value()"))
    There can be only one.

  3. #3
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,663

    Default Re: How to add a unique filter to a summary operation?

    Since I don't know which categories will be included, I tried a crosstab on the set and put a condition on the count as unique_key_value() and added a filter for the date range. That created a new table that I can now use for the summary op. I tried using key_unique("client_id") as the condition in the summary but it added it to the filter and only returned 123 records (unique_key_value() wouldn't work there).

    In your example above, my guess is I would run that command for each category I want to count? And then perhaps post those values to the temp table in my set?
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

  4. #4
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: How to add a unique filter to a summary operation?

    Sorry, lost me when you threw in categories.
    There can be only one.

  5. #5
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,663

    Default Re: How to add a unique filter to a summary operation?

    The ethnic field will have different codes, so my summary needs to count each of those codes separately. You know how many are Asian, African American, Caucasian, etc.
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

  6. #6
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: How to add a unique filter to a summary operation?

    Might be easiest to do a separate summary for the date range filter grouping on the ethnic field and counting each. Post those results back to the other summary table.
    There can be only one.

Similar Threads

  1. Summary Operation on a set - moving to web
    By RobPolley in forum Application Server Version 10 - Web/Browser Applications
    Replies: 0
    Last Post: 03-19-2013, 06:37 PM
  2. Pulling last value in a summary operation
    By John Henry in forum Alpha Five Version 10 - Desktop Applications
    Replies: 1
    Last Post: 06-27-2012, 02:20 PM
  3. Summary Operation Order
    By Ronald Anusiewicz in forum Alpha Five Version 8
    Replies: 14
    Last Post: 11-07-2007, 10:10 AM
  4. summary operation sort
    By Frank Calandro in forum Alpha Five Version 7
    Replies: 8
    Last Post: 03-30-2006, 09:29 AM
  5. Summary Operation
    By Bill Lewis in forum Alpha Five Version 4
    Replies: 4
    Last Post: 04-07-2002, 04:53 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •