Normal Topic Suppressing Repeating Values in a Report (Read 778 times)
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Suppressing Repeating Values in a Report
May 20th, 2004 at 7:20pm
Print Post Print Post  
Quote:
I can't figure out how to suppress repeating values that I've sorted and am doing a "count" of.  If I have 10 records with "Texas", I get 10 lines in my report showing "TX" and then in the next column, my value of 10.   HELP (anyone!) - how do I suppress the 10 lines of "TX"?

TJ,

I just started to experiment with reports yesterday, so I may not have the best solution.
[Erika, please tell me there is an easier one.]

The best I have come up with, is to do it with programming within the REPORT design, like this:
Code
Select All
///// Global Code /////

stat CurrentCopy as string
stat DelayedCopy as string
 


Code
Select All
///// Place this code in the element programming for the "Group Body" value that you want to suppress. /////

CurrentCopy = Category

if CurrentCopy = DelayedCopy
 clear([Name of LE that you want to suppress])

DelayedCopy = CurrentCopy
 



This was designed to work with TEXT values. I'm sure it would need some modification to the variable declarations to work with other data types.

Let me know how you make out.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Suppressing Repeating Values in a Report
Reply #1 - May 20th, 2004 at 7:43pm
Print Post Print Post  
If I understand the question TJ, you want a report that looks something like this,

AL  5
AR  25
TX  10
WV 13
..
..
Total: 3,654

If that is the case I recently finished up a report that did this exactly with the Customers Sample Application. It will be available in the Sample Database section of the forum as soon as it goes through checking. It is a little too complicated to explain over the forum, but be patient and you will be able to see it shortly.
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
TJCajun
Junior Member
**
Offline


"Laissez les bons temps
rouler"

Posts: 72
Location: Louisiana
Joined: Nov 25th, 2002
Re: Suppressing Repeating Values in a Report
Reply #2 - May 20th, 2004 at 8:02pm
Print Post Print Post  
Carl - I'll give this a look as soon as I can.  Thanks!

Ray, yes, that's what I'd like to be able to generate in a report.  It wasn't hard to set up a simple report to do a "count", but I kept getting the repeating lines for each value [ie, 10 lines for 10 values (10 records in the db) for "blue", 22 lines for 22 values (22 records) of "red", etc.]  I sure thought there would be an easy way to suppress these repeating lines...
  
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Suppressing Repeating Values in a Report
Reply #3 - May 20th, 2004 at 8:11pm
Print Post Print Post  
Basically you have to make muliple passes through the result set by adding a second "view" to the report. The first pass/view merely counts the entries, the second one then prints the results. This is also how you can get a grand total to line up under the same column as subtotals (using the width of each column).
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Suppressing Repeating Values in a Report
Reply #4 - May 21st, 2004 at 3:06am
Print Post Print Post  
Sorry TJ,

I didn't realize that you were also counting the State LE. I'm afraid my answer won't help you.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Suppressing Repeating Values in a Report
Reply #5 - May 21st, 2004 at 12:30pm
Print Post Print Post  
Carl,

Actually - I think your technique would help him on the second pass through the data - to supress the repeats of the same state while printing the counts.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged