Week numbers and summaries

mj vdb
mj vdb used Ask the Experts™
on
We want to get the salary status per week number. The user enters the 'year' and the 'until week number'. Crystal Reports works with an excel sheet with payment dates and salary amounts. So far, we have been able to get the week numbers and summaries for the desired 'week range', but we don't get every week number.

Example:
If the user enters '2015' and 'until week number 29', he should get:
-29 weeks (1 to 29)
-Per week number either 'the sum of the salary amounts' or '0'.

The null is required when nothing was earned in a specific week number. In such a case, the excel sheet is useless and the null should be created and combined with the specific week number.

How do we get 'a week number and a null' if the week number ended up with nothing?

We thank you,

Mike ea
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
MouseCaptainHelp Desk Analyst

Commented:
Sounds like your data range has two colums: Date and SalaryPaid.  You'll need add two additional calculated columns: one to concatenate a unique identifyer using year and week number.  And the other using cumulative addition which resets at the beginning of each year (previous row's YTD + current row's payment, with a condition based on whether year is same as prior row) to calculate salary paid YearToDate.

See attached example.

TJ
YTDsalary.xlsx
Ido MilletProfessor of MIS at Penn State Erie and Owner, Millet Software

Commented:
Create a table (or in your case, an Excel named range) with one row per week.
Do an Outer join from that table to the salaries table.

Author

Commented:
Thanks. We specifically didn't expect a tailored sheet. On the long term the approaches may be put into the equation, but they won't make it at this stage. For now, the end user can't enhance the source and the setup can't be changed as well.

Specs:
-Fixed source with columns 'date of payment' and 'salary amount'.
-End user enters 'year' and 'until week number'.
-Crystal goal: show the result (salary sum or null) for each week number. Ytd etc are not required.

W're looking forward to the advices as to how we have to design this in Crystal.

Mike ea
CompTIA Security+

Learn the essential functions of CompTIA Security+, which establishes the core knowledge required of any cybersecurity role and leads professionals into intermediate-level cybersecurity jobs.

Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013

Commented:
What is your input source?

Is it a database?

Can you provide sample data?
Doesn't need to be real just typical.

mlmcc

Author

Commented:
The excel source we use represents the version the end user has to work with.
The sample shows how basic it is.

Mike ea
sample-source.jpg
Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013

Commented:
Is this what you want.  It uses IdoMillet's idea of a date table

mlmcc
Salary-by-Week.rpt
salary-by-week.xls

Author

Commented:
Salary-by-Week.rpt:

A) We look for column-2 'Week Number' and column-3 ' Salary for Week' , but they have to be changed.
The issues:
-Example1: column-2 shows two entries for week number 1 and we want one entry per week number.
-Example2: next to week number 4 the cell in column-3 needs to show '0.00'. In fact, for any week number without salary we want to see a '0.00' in column-3. Week numbers without salary / week numbers with '0.00' are not part of the excel source: Crystal has to deal with this on its own.

B) Column-4: there is something going on with the running total, but the case doesn't need it.


In short: when a week number has no salary we want Crystal to generate the number '0.00' in column-3 by itself.


Mike ea
Senior Consultant
Most Valuable Expert 2011
Top Expert 2013
Commented:
Is this what you need?

mlmcc
Salary-by-Weekrev1.rpt

Author

Commented:
done

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial