Consolidating records on Crystal 11? - crystal-reports

I am trying to consolidate the records on my report to show only unique lanes (Shipper State and Destination State).
My data is currently grouped by customer group and then customers that fall within each group.
Ideally I would like my data to fit in this format.
LANE ACCEPTED Total Percentage
Customer Group: Fruits
Customer: Apple
GA-TN 1 2 50%
GA-FL 2 3 66%
Customer: Bannana
GA-TN 2 4 50%
Total 5 9 55%
Currently my data looks like the image attached.
Thank you in advance.

1) Consolidated the Lanes by creating it in Formula Field, followed by creating adding it to the Group

Related

Data studio calculated fields

I have the following dataset:
Week #
Company Name
Product
# of transactions
Week1
Company A
Product 1
100
Week1
Company B
Product 1
30
Week1
Company A
Product 2
100
Week2
Company B
Product 2
50
My goal is:
for each COMPANY (there could be multiple rows per company) calculate Usage score with the following formula total # of transactions per company/100. For example, from the table above Company A has 200 transactions and Usage score=2 - I've done it successfully
categorize each company per the following formula: when usage score>1 then "promoter" else "critic" - I've done it successfully
Count promoters and critics - that's where I fail. Data studio in this case calculates Usage score and NPS per row, not per company. Therefore, I have promoters per product, not per company.
please help, I'd appreciate
You can solve this by Re-aggregating the Datasource with itself where the Second Join is the Datasource itself with the Key Company Name and the Metric Usage score make sure to set its Aggregation to Average.
Now you have a new Datasource with each Company and Row having its Usage Score in one column.
Unfortunately I don't understand the NPM part.
Hope this help though

Tableau - Related Data Source Filter

I have data split between two different tables, at different levels of detail. The first table has transaction data that, in the fomrat:
category item spend
a 1 10
a 2 5
a 3 10
b 1 15
b 2 10
The second table is a budget by category in the format
category limit
a 40
b 30
I want to show three BANs, Total Spend, Total Limit, and Total Limit - Spend, and be able to filter by category across the related data source (transaction is related to budget table by category). However, I can't seem to get the filter / relationship right. That is, if I use category as a filter from the transaction table and set it to filter all using related data source, it doesn't filter the Total Limit amount. Using 2018.1, fyi.
Although you have data split across 2 tables they can be joined using the category field and available as a single data source. You would be then be able to use category as a quick filter.

Crystal Report XI: calculate subtotal % of total

I have a report that calculates a summary field by group location which I am calling a sub total. There is another summary field by company in group company section. We allocate corporate overhead costs based on volume of revenue. I need to take the location total revenue and divide by the overall company revenue to get the % of volume. My problem is that I cannot get the company total into the location group row without effecting the numbers. I have tried to create a running total field to get the total. I have tried referring to the main report to get the company total and I have tried summarizing the location totals but I cannot summarize a summarized field. Any suggestions would be really helpful, thank you!
Company Locations---------- Total Revenue-------- % of Volume
California------------------------ 500,000----------------- 500,000/950,000 ?
New York ---------------------- 300,000
Ohio ---------------------------- 150,000
Company Total: -------------- 950,000
This looks like the same thing I am trying to do but I don't understand the answer yet..
http://www.experts-exchange.com/questions/27749404/Crystal-Reports-XI-fixed-value-for-denominator.html
your best option is creating a subreport on the report header to calculate only your total revenue and then using it on your main report through a shared variable.
if sum({totalRevenue},{location}) > 0 then
sum({totalRevenue},{location})
/
sum({totalRevenue})

how do i subtotal on groups based on a condition

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)

Creating conditional total rows in SSRS

I am creating a report that has to mimic and existing report… it has grand totals and subtotals.
Problem is the subtotals are based on different criteria…
So:
Apples 5
Oranges 6
Beans 3
Grapes 8
Peas 3
Total Fruit: 19
Total Veggies: 6
Grand Total : 25
Assuming I have a field that tells me if an item is Fruit/Veggie, how can I create grand subtotal row (at the bottom of the page) that will only add based on the value of another field?
I do not want separate groups. The format should remain as is.
Add calculated fields to the underlying dataset that total Fruit and Veggies separately. That way the appropriate sub total can be based on the calulated field.
If you had a field that was ItemType, containing "Fruit" and "Vegetable", you could create a function like =Sum(Iif(Fields![ItemType]="Fruit",1,0)) to sum only the fruit.