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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculate who is onsite now 1

Status
Not open for further replies.

odins701

IS-IT--Management
Sep 6, 2020
48
0
0
US
Hi all! I need some help with my report. In the example screenshot below, there are 2 employees. Cliff has entered the site but has not left. Jesse has entered the site and has left. This means that 2 have been on site for the day, but 1 is on-site now. A distinct count of the employee id gives me the total of who has been on-site for the day. I need to calculate who is still on site. In the Entry/Exit column, 1 = entry and 2 = exit. Note: it is possible that someone may come and go multiple times throughout the day. If Jesse were to come and go twice in a day, he would have 4 records returned. I'm grouping by employee name. Could someone help me with this? I am using crystal reports 2020 patch 1 version 14.3.0.3569.

Example_hlorqw.jpg
 
Yes, that is correct.

In the formulas containing variables, make sure they are referenced as "shared number variable."

-LB
 
only 1 formula in the sub-report using shared variable, @onsite and 1 formula in the main report referencing the shared variable
 
can i send you a copy of the report to look at? i can make it downloadable from dropbox. i can also include a backup of the test db if needed.
 
there is no personal info in the test db
 
Please attach the report using the attachment box below the reply box.

-LB
 
In the subreport, you need to place {@OnSiteNow} in GF1.

-LB
 
Ok, did that. getting same total as the total been onsite. Screenshots below...

1_uok3mo.png


2_ulf7pf.png
 
That is the correct answer with the current data. In your original post, Golby came and then left, but in this post, he came back.

-LB
 
right he came back, so only 1 person is onsite now. it shows 7 onsite now (currently)
 
so... 7 people have been onsite today and 1 is onsite now.
 
You are right and awesome! screenshot below...

1_rrixwx.png
 
Also consider this...

If the report is ran for today as in the example above, there are 9 events. However, id the report is ran over the last month, there will be many more events, thus the Summee will be greater. Just FYI.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top