Skip to Content

CrossTab Issue

I have a crosstab in my report that calculates average LOS. However, I am not getting the correct avg. I have 2 patients, one was here for 3 days and one was here for 4 days, which would be a total of 7. However, I am getting the average as 3.67 when it should be 3.5.
crosstab.jpg (23.5 kB)
formula.jpg (15.6 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Nov 24, 2016 at 06:46 PM

    Strange behaviour.

    Are the fields in your formula in Date or DateTime format?

    What is the version of your Crystal Reports?

    I will try to reproduce the issue.

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 24, 2016 at 07:07 PM

    works in my test in CR 2013 SP7:

    What I am doing differently?
    Add comment
    10|10000 characters needed characters exceeded

  • Dec 01, 2016 at 04:39 PM

    I added a summary (attached) but the summary counts each row for the patient. I have the patient info in a group. So for example: patient1 was here 3 days and patient2 was here 4 days. If I put the patient info in the details section then patient1 shows up 3 times and patient2 shows up 4 times that's why they are in a group so it only pulls the patient 1 time. The summary is adding patient1 3 times for a total LOS of 9 when it should be 3. Patient2 shows up 6 times in the details section and the summary shows a total LOS of 24. Can a summary not add up the LOS when the information is in a group ? The total LOS for both patients should be 7.

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 05, 2016 at 06:48 PM

    I just want to add up the 2 rows that are 3 and 4 in bold on the screenshot and then get an avg. So it would be a total of 7 divided by 2 for 2 patients and the avg is 3.5. My crosstab keeps adding rows multiple times, etc.....

    Add comment
    10|10000 characters needed characters exceeded