Can you post a workbook or spreadsheet (a dummy one with a few row if your data is confidential).
Need to see the structure of your datafile.
You can create calculated field as below:
Column Name- Good Records
if [Quality] = "Good" then [Number of Records] else 0 end
Column Name- Bad Records
if [Quality] = "Bad" then [Number of Records] else 0 end
Use this if [Quality] = "Good" then [Number of Records] else null end. This will give you all the records which are good along with empty value. Filter out empty value and use aggregation as count to see total number of good records.
Hi Vikas, if the quality field has "Good" and "Bad" as values, then the following should work:
Good records: IF [Quality] = "Good" THEN 1 ELSE 0 END
Bad records: IF [Quality] = "Bad" THEN 1 ELSE 0 END
Thanks for your input, but this I already have tried earlier but got no success.
As the data is confidential, I am unable to attach the workbook. But will create dummy data to get the clarity.
When I tried the same solution it didn't helped me.
I will be attaching the workbook and sample data in csv format shortly.
Can you share the workbook which you created with solution.
Hello @Aditya / @Glenn,
Please find attached sample data and tableau file to original post.
It contains only 2 columns as I have hidden unused fields while extracting.
I am looking for below output -
1. Count of Good Records - in separate variable / measure
2. Count of Bad Records - in separate variable / measure
3. Good to Bad Ratio
4. Bad to Good Ratio
if attr([Call Quality - Split 1])="Bad" then SUM([Fixed]) / LOOKUP(sum([Fixed]),1)
elseif attr([Call Quality - Split 1])="Good" then
LOOKUP(sum([Fixed]),-1) / SUM([Fixed]) END
NOTE: I used Custom Split to clean your data which is corrupted with extra quotations "Good"
Please mark it as correct/helpful if it has helped you so that it can benefit other users with the same question.