1 2 Previous Next 15 Replies Latest reply on Feb 8, 2013 5:25 PM by Gerardo Varela

# Count records which match a Calculated Field, at the lowest level

I have a source which looks like this:

Store
Sales
Store15
Store24
Store32
Store46

Then I create a Calculated Field which Returns value 4

So now, I want to get a total of the number of stores greater than 4, based on SALES field.

In this case is: 2

How can I can create in TABLEAU a calculated field or calculated attribute which returns "2" (count of stores which sales are greater than 4)

Regards

• ###### 2. Re: Count records which match a Calculated Field, at the lowest level

As Shawn suggested a sample Workbook would be optimal so we can see what you are trying to accomplish.  Check out the workbook I've attached.  I'm not sure that's what you are looking for but its a start.

• ###### 3. Re: Count records which match a Calculated Field, at the lowest level

oops

im working in v8 beta

would that work?

• ###### 4. Re: Count records which match a Calculated Field, at the lowest level

I'm not 100% sure since I've yet to dabble in v8 , I'm still new to v7,  but I wouldn't see why not.

• ###### 5. Re: Count records which match a Calculated Field, at the lowest level

This is what I want to do:

First column is name of the store

Three remaining are CALCULATED MEASURES

I want to get the COUNT of "1s" and the COUNT of "0s" in the first CALCULATED MEASURE (CumplimientoObjetivo)

So I would expect a calculated attribute or measure which shows:

# of 1s=5

# of 0s = 3

The problem is that CumplimientoObjetivo is calculated at the STORE level....

• ###### 6. Re: Count records which match a Calculated Field, at the lowest level

Armando,

Can you post a sample of your work book so I can see what you really need?

Gerardo

• ###### 7. Re: Count records which match a Calculated Field, at the lowest level

Hi Armando. Welcome to the forums. Have you read this wonderful guide Tracy put together? If not, you really should; it might help you, help us, better help you.

Thanks,

--Shawn

• ###### 8. Re: Count records which match a Calculated Field, at the lowest level

Thanks

I know how to do that.

Since I am using sensible data I can not just post as is, so I would probably need to generate the sources again using DUMMY data

• ###### 9. Re: Count records which match a Calculated Field, at the lowest level

Hi Armando.

You do make a good point: someone is going to have to spend time generating DUMMY data. It has been my experience that the questioner is in the best position to do this tedious task, especially considering they 'know' the sensitive data better than anyone else can guess what it looks like; don't you think?

And by the way what does this mean: CumplimientoObjetivo ?

Hope you'll take the time to help us answer your question. But if not, there's always tech support, they're really good at dealing with stuff like this.

--Shawn

• ###### 10. Re: Count records which match a Calculated Field, at the lowest level

Shawn,

I've been a long time lurker and this is my first attempt to solve someones problem, please correct me if I make a mistake.  "CumplimientoObjetivo" translates into Compliment Objective.  By the look of the screen shot he posted he is comparing compliments items/services sold by different stores. So I believe Armando is looking for the  COUNTS of both the compliments and lack there of.

Gerardo

• ###### 11. Re: Count records which match a Calculated Field, at the lowest level

Hi Gerardo thanks for the translation. I am totally language-challenged and envy all you multi-lingual forum folks!

So if you were going to try to "represent" his data, and question, how would you do it? I usually use SuperStore to start, but maybe his is really unique data. So help me out a bit, what does this image mean:

And what should we substitute in for his sensitive data? And can you produce an Excel spreadsheet we can all experiment with to get where he's trying to go? It would be great if you're willing to help out with this! (And why couldn't he do it?)

My Point: At some point someone needs to spend less than the time I took to write this response to produce some sample data which represents the data structure that isn't working, so we can help him. Who should do that?

--Shawn

• ###### 12. Re: Count records which match a Calculated Field, at the lowest level

Shaw,

I think the problem is that the CumplimientoObjectivo, by the way I translate wrong its more like duty/promise objective, is a calculated field and you can't aggregate an aggregate. I'm not sure how he wants to display the data which changes how you approach the problem. Attached is a quick and dirty solution

-Gerardo

• ###### 13. Re: Count records which match a Calculated Field, at the lowest level

Gerardo

That´s exactly what I want to accomplish

In your example, the number would be 5

So now, How to get it when it is a calculation (on the fly) or in other words, an aggreation which has to be aggregated based on the aggregation´s results at the STORE level, considering that the number 5 is a result of the TOP level

• ###### 14. Re: Count records which match a Calculated Field, at the lowest level

Yes Gerardo I too am curious. Thanks.

--Shawn

1 2 Previous Next