1 2 Previous Next 16 Replies Latest reply on Mar 8, 2018 8:05 AM by Aditya Singh

How to extract value / data from Measures?

Hello Colleagues,

I have a measure as "Number of Records" which contains two types of records.

1. Good Records

Good and Bad records are saved in one of the dimension - "Quality" Please find attached table which is getting generated when I am putting 'quality' in rows and 'no. of records' in label.

I want a measure which will contain only bad / good records. How can it be done?

Note - I am using tableau desktop 10.4.1.

Best Regards,

Vikas Agrawal

• 1. Re: How to extract value / data from Measures?

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.

-- glenn

• 2. Re: How to extract value / data from Measures?

You can create calculated field as below:

Column Name- Good Records

if [Quality] = "Good" then [Number of Records] else 0 end

if [Quality] = "Bad" then [Number of Records] else 0 end

• 3. Re: How to extract value / data from Measures?

Thanks for your input, but unfortunately it does not give me correct result.

The output i have received after applying the solution is as attached.

• 4. Re: How to extract value / data from Measures?

Hi Vikas

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.

• 5. Re: How to extract value / data from Measures?

Still no success -

Regards,

Vikas

• 6. Re: How to extract value / data from Measures?

Hi Vikas

I have bad and good records along with Total records.

• 7. Re: How to extract value / data from Measures?

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

-- Glenn

• 8. Re: How to extract value / data from Measures?

Hello Glenn,

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.

Br,

Vikas

• 9. Re: How to extract value / data from Measures?

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.

Br,

Vikas

• 10. Re: How to extract value / data from Measures?

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

Best Regards,

Vikas

• 11. Re: How to extract value / data from Measures?

PART1

{ FIXED [Call Quality]: sum([Number of Records])}

Then drag it to colors

• 12. Re: How to extract value / data from Measures?

PART2

• 13. Re: How to extract value / data from Measures?

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.

Thanks,

Ritesh

• 14. Re: How to extract value / data from Measures?

STEP 1

STEP 2

1 2 Previous Next