Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple Combinations of Data

Status
Not open for further replies.

ternas1

Technical User
Jun 29, 2010
13
US
Hello, I'm using CR 11 and I've been asked to write a report showing if certain combinations of charges show up on the same date. If they do that's an error.

The report currently uses the "Is one of" function to show all the charges grouped by service date, but some dates only have 1 charge which is OK, and other dates have multiple charges and their combinations are OK. How can I narrow the field to just certain combinations of charges?

For example, charge #9080 cannot be on the same date as #9300 or #9305, but #9300 and #9305 can be on the same date.

What I have now looks like the following, but only 9/3 has a combination that my customer wants to see.
There are many other combinations and combination lengths, but I hope this gives you the idea.

9/1: #9080 (OK)
9/2: #9300, #9305 (OK)
9/3: #9080, #9300 (not OK)

Thanks in advance for any suggestions.
 
Are these charges coming from separate fields? What report section are we seeing here? What are the related field names? What is the group structure? You mention a date group, but is this per some outer group, e.g., account?

-LB
 
The charge numbers come from the same field, {Chargenum}.

The details section is shown along with the following groups:
{Dept}
{Account}
{Servicedate}
 
If the report should ONLY show the errors, then you could do the following. First change the record selection formula to show only the three charges:

{table.chargenum} in [9080,9300,9305]

Then write a formula:

//{@9080}:
if {table.chargenum} = 9080 then 9080 else
if {table.chargenum} in [9300,9305] then 9300

Then go to report->selection formula->GROUP and enter:
distinctcount({@9080},{table.servicedate}) > 1

Then if you want to count the errors, use a running total that does a count of a recurring field, evaluate for each record, reset never, and place it in the report footer. Inserted summaries would count the non-group selected records and thus be inaccurate.

-LB
 
That works if I limit the selection to just those 3 charges.
However, I have a list of 20 charge numbers with various combinations.

From the list of 20, charge numbers 1 - 5 can be together on the same date, but they can't be with any of the numbers 6 - 20.
And within the 6 - 20 set, some can be on the same date, and some cannot.

This is confusing even to me. Here is another way to look at it.

Listed Charge Numbers
1. 9080
2. 9085
--------
11. 9300
12. 9310
13. 9315

Charges #1 and #2 can be on the same date.
Charges #11 and #13 can be on the same date (with any in 1-5).
Charges #11 and #12 cannot be on the same date, but can be with any in 1-5.

Does that make any sense?
 
Hi,
What determines if a charge number can or cannot be on the same date or combined with other charges?

If it is exactly what you wrote it seems a formula could be developed ( after grouping by date), that tests the various conditions and returns a 1 or 0 depending on the result ( 1 if an error, 0 if not) - you could then display only those with 1 ( the Not OK ones) using a supression formula, maybe
even incorporating the test into the supression formula itself.



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Turkbear and LB, thank you for your suggestions.

I tried a small sample size using an if-then formula along with a supression formula, and it appears to have worked. I'll need more time to test larger data sets, but I think you've pointed me in the right direction.

To answer your question: it's the government (Medicare) that decides which charges can be on the same date.

Thank you!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top