I have a bunch of data about people attended or unattended, and I want to sepparate them. In one column I have '0' for unattended people, and some number for the attended ones. How can I show that in a report? I want a pie chart that divides them, and I've spent many hours in this, I don't even know how to search about it and I have almost no experience with Crystal Reports.
I've tried making two summarize formulas for acumulated totals like this (the other one looks almost the same):
StrCmp(ToText({table.Atendido}),"0") <> 0
But I can't use that in a pie chart. And it doesn't even stores the data as it supposed to do, in my data I have 8 unattended, 1 attended. This formula gives me 9 as result.
Any help is greatly apreciated, thanks!
My data looks like this:
IDPerson Person Attended
1 John 0
2 Mary 0
3 Graves 1
4 Paula 0
In the report I need:
Who was attended (list of people)
A pie chart of attended, unattended with percentages and all
If I group by Attended, the groups form like this:
There will be many groups of numbers > 0, I just need groups sepparated by:
attended = 0
attended != 0
I hope i understand your question but if you group on Attended then you should be able to get what you want with count functions.
I was over complicating it, because I'm inexperienced and in a hurry...
I made a formula to separate both values:
if tonumber({PacientesAtendidosYNoAtendidos.Atendido}) = 0 then 0 else 1
Then, I just grouped by that. Very silly, indeed.
Related
I use two different excel files in one report. The columns of the excel files are stored in fields. I want to show the columns side-by-side:
Excel Data 1:
ID Name
1 Blub
2 Blub2
Excel Data 2:
ID Income
10 10134
20 134343
So the result should look like this:
ID Name ID Income
1 Blub 10 10134
2 Blub2 20 134343
I tried it with two different Detail sections (I have to use detail sections) and activate the overlaying of underneath sections for both detail sections.
The result looks like:
ID Name ID Income
1 Blub
2 Blub2
10 ....
20 ....
That is because we use a function model of BW that will give us the data back like this:
ExcelFile ID Name Income
1 1 Blub
1 2 Blub2
2 10 10134
2 20 134343
I can not use sub reports and cannot use single fields for each value because there are 100 cells in there...
Does anyone knows a solution?
You have to split your detail row vertically to do that. Something similar already solved by me here. Be careful when you width of data size.
If it doesn't help you enough, feel free to ask with additional questions.
I tried it:
Data looked like this:
After that it looked like this:
I did a Grouping on the names "GS_FC...." so there are two groups in the report. Than I put the Field which contains the name of the Excel File (GS..._TFCF and GS...._NFD) in the Detail section with this settings:
Is this the right thing to do?
I have a table of jobs, with columns showing which engineer the job is assigned to and the area of the country, which can be simplified like this:
JobNumber Area Engineer
1 A 3
2 D 1
3 E 2
4 B 2
5 A 1
I have a table of engineers, and a table of areas of the country.
I have a final table which shows the areas of the country each engineer is assigned to, like this:
Area Engineer
A 1
A 2
A 3
B 2
B 3
What I need to do in Crystal Reports, is create a formula field (or similar) to show whether or not the engineer was in one of his assigned areas.
I think the reason my efforts thus far have failed is that the join is effectively circular. I have played around with SQL Commands and join options to no avail.
Can anybody offer advice on how I can solve this problem?
I have a report grouped by provider and then patientID. I have a formula which gives the last time since an interaction between the clinic and a patient occurred. I want simply to sort the results by that measure. I have created a flag that marks 1 if the time measured is 6 months or greater and 0 if not on the detail level but this does not allow me to sort either.
Code:
DateDiff("m",maximum({Ticket.TicketDate},{Ticket.PatientID}),CurrentDateTime)
#flag
if {#TimeSinceLastInteraction} >= 6 then 1
else 0
All help is greatly appreciated!
A possible workaround would be to export to XLS (data only) and do sort with excel.
My report is grouped on clinic, staffname with subtotals by clinic. I need to count patients by staff where they had more than 1 admit date. I can get the correct grand total, but on the detail and subtotals, it is a progressive number.
Here's what I want
clinic1
staffname1 10
staffname2 95
subtotal 105
clinic2
staffname3 6
subtotal 6
grand total 111
Here is what I get:
clinic1
staffname1 10
staffname2 105
subtotal 105
clinic2
staffname3 111
subtotal 111
grand total 111
A lot of this may depend on the structure of your data, e.g., what is in your "detail" level. I am also assuming that you want to count of how many patients had more than one admit date, not the total number of admits for patients with multiple admits. Given that, and assuming a patient will only appear once per admit date, then this should work:
Group by patient also, so it's clinic -> staff -> patient, but suppress that group.
Create a formula to count if the number of records in each patient group is more than 1, something like this: if count({patient},{patient}) > 1 then 1 else 0
Take the formula you just created, and use it to make a summary field wherever you want a total, e.g., in the staff head it will give you a count or that staff member, in clinic it will do so for clinic, etc.
Something else to consider: I'm guessing this could be intended to gauge staff on their quality by seeing how many patients had to seek additional treatment. Even if that's not the full intent, whatever this is being used for could be skewed by staff encountering more/fewer patients. For example, staff that have 10 readmits out of 100 visits would look worse than someone who only had 5 readmits, but had also only seen 20 patients.
So: Along with the metric on which you are requesting information, I would also add a ratio metric. In the staff header, this would be straightforward: count({patients}) / distinctcount({patients}) which will give you the ratio of distinct to repeat visits. Keep in mind also that this could skew high for a staff member that had, for example, 50 patients, but one of them came back a dozen times.
To get the count of the fields that has Greater than 1.
Assuming the count field is a database field and value coming directly from database
Create a formula #Count and write below code. Place the forumla in details.
:
if(databaswefield.count > 1)
then 1
else 0
Now take the summary of the #count formula in required group footers.
Let me know if you are looking for something different.
Edit..............................................................
If I got your comment correctly.
Though you take distinct count you can use that in your calculations by storing the value in a shared variable. Something like below and you can retrive value from that variable
Shared Numbervar count;
count:=distinctcount(patientid)
i have been having trouble for a while figuring this out. I am looking to combine the rows that have duplicate "materials" and in doing so sum up the quantities of each and the prices.
Material qty unit price
a 5 20.00
a 5 20.00
b 2 5.00
c 1 5.00
and to get it like
Material qty unit price
a 10 40.00
b 2 5.00
c 1 5.00
Ive looked and found similar questions but couldnt figure it out. sorry if its a repost.
Thanks
When you begin creating the report, one of the first options is grouping, followed by aggregates (sum, count etc.). Once you finish the report wizard, suppress the details and the group headers.
Create a Group based on your Material field and then insert a summary by right-clicking on your qty field -> Insert Summary.
If you can't (or don't want to) group, then you will have to create running totals to summarize your different materials.