?
Solved

if then statement for first record of a group <> last record of the previous group?

Posted on 2012-03-22
6
Medium Priority
?
423 Views
Last Modified: 2012-03-22
How to create an if then statement for first record of a group <> last record of the previous group?  this refers to group #2
0
Comment
Question by:kgittinger
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 101

Expert Comment

by:mlmcc
ID: 37753150
Do you have a group in the report?
If so there is no real need for this test.

Test should be

If (OnFirstRecord OR {YourField} <> Previous({YourField}) then
    Do something with the first record of the group


mlmcc
0
 

Author Comment

by:kgittinger
ID: 37753217
I have tried this
if not onFirstrecord and {Table.employee_number} <> previous({Table.employee_number}) then 1 else 0
 but if the employee_number is the same as the last employee_number of the previous group it returns a 0

I do not know how to call the group...

Please know, group 1 is employer, group 2 is class.  Employees can be in multiple classes

Thank you very much.
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 37753561
You can't call the group as such.
You put the formula on the report and at that point you have the current record and the previous record.

WHat are you trying to accomplish with this?

mlmcc
0
[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them.

 

Author Comment

by:kgittinger
ID: 37753600
I need a listing of employees (of which could be in the same plan/class for multiple  occurances), but I only want to count them once.  I cannot use distinct count because the cross-tab does not add distinct count of groups...

Here is my entire formla for counting employees

if onFirstrecord
then 1 else
if not onFirstrecord and {Table.employee_number} <> previous({Table.employee_number}) then 1 else 0

is there an first record of group(2) as opposed to OnFirstRecord?

Thank you.
0
 
LVL 101

Accepted Solution

by:
mlmcc earned 2000 total points
ID: 37753642
YOu can use DISTINCTCOUNT as a summary of the employee field

If you have this as the data

employer    Class    employee    yourformula
emp1          class 1    joe                 1    
emp1           class1    tom                1
emp1           class2     joe                 1                           joe is not the previous
emp1           class3     joe                 0                           joe is the previous

Right click the employee field
Click INSERT --> SUMMARY
Change to DISTINCTCOUNT
Put it in the employer group footer

mlmcc
0
 

Author Closing Comment

by:kgittinger
ID: 37753701
Thanks a million!
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question