Solved

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

Posted on 2012-03-22
6
404 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
Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

 

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

821 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