Data studio calculated fields - aggregate

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

Related

How to Display the Sales and Other Department Sales Seperatly on Tally

hope you all are good .I new to tally and I have a new situation ,I have provided the details below
1.we Own a supermarket and which contains some other departments as well
2.only one counter is available for this supermarket section
3.so the sales of other departments also get mixed with the total sale
Task :- when I enter this data into tally I have to show the other departments sales seperatly on balance sheet, how to achieve this
The Profit & Loss statement in Tally shows you the sales data of every Sales ledger separately. So, to have data on separate sales for separate departments, you will have to make different sales ledgers for different departments and make the entries accordingly.
If you are using combined single ledger for all sales, then you should make three ledgers now for sales of each of the three departments. If you are using sales ledger item wise or tax slab wise, then you need to create similar ledgers for every department and take care of choosing the right ledger when creating the voucher.

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.

Visual Studio 2008 - name with more than one visit. I need an expression to count a distinct name ID on a date

I have a Visual Studio 2008 report with name, nameID, date of service, DOB and several other columns. I need to count the distinct name (using the name ID) visits (date of service). Some names have more than one date of service with more than 1 transaction (names=30, datesvc=36, transactions=80).
They are grouped by Name, NameID (hidden), DateSvc, Transaction.
I thought Count(DateSvc) would work but it gives me the same amount of transactions, not visits.
Any help is appreciated.
I cant put a sample of the data due to confidentiality. But here's a typed sample of it:
Name......Date......DOB......More columns
DOB to the right can be several rows depending on the transaction
Service Date can span one or several rows depending on the date of the transaction
The name spans all rows for that persons transactions on the specific service date
Name.....1/1/16.....9/5/2008.....trans 1 for that day
...............1/4/16.....9/5/2008.....trans 1 for that day (same person)
...............1/4/16.....9/5/2008.....trans 2 for that day (same person)
Name.....6/9/16.....3/7/2002.....trans 1 for that day
Name.....6/9/16.....5/1/2000.....trans 1 for that day
This should show 3 names, 4 visits and 5 transactions
The 4 visits is where I'm having the problem.
Or a Snippet of the above but with data deleted out:
I hope this gives more clarity.
Based on the example you put in your question I built a tablix with the following expressions:
Total Names: =CountDistinct(Fields!Name.Value)
Total Visits: =CountDistinct(Fields!Name.Value & "-" & Fields!Date.Value)
Total Transactions: =Count(Fields!Record.Value)
In your case Record should be MedicalRecordNum and Name should be PatientID instead of the name to avoid counting people with the same name.
The result is:
Let me know if this helps.

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})

SSRS 2008 R2 - Group toggle aggregates

I'm working with a dataset where employee utilization is calculated as (Time Billed to X/Standard Billable hours). As such, to get the total billable percentage for an employee, I can just sum up the percentages billed to each client. However, I also want to be able to see the percentage of time billed by department.
I've currently got my data in a matrix with row groups Department-->Employee-->Client with 1 column group of "time sheet ending date". When I toggle the visibility of the client row group based on the employee row group, I get the correct totals at the client and the employee level. However, when I toggle the visibility of the employee row group based on the department row group, the department row group has the wrong totals. For example, if Department A has employee B with 90% utilization and employee C with 95% utilization, the toggled total at the department level is 185%....However, I am expecting to see 92.5%....any ideas????
You might just need to tweak the expression used to get the department total. I am unsure what expression exactly you used, but it should be of the form:
SUM(epmployeePercentageColumn)/COUNT(employeePercentageColumn)
obviously replace the "employeePercentageColumn" with whatever field or variable or expression that represents each of the employee percentages that come under the particular department.
If your current expression isn't in that form, try and tweak it.
Hope it Helps.