Solved

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

Posted on 2012-03-22
6
403 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
  • 3
  • 3
6 Comments
 
LVL 100

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 100

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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 

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 100

Accepted Solution

by:
mlmcc earned 500 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
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…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

813 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now