5 Replies Latest reply on Nov 15, 2018 12:10 PM by Michael Ye

# Questions regarding filtering and count expression

Hi there,

I was wondering if anyone can point me in the direction of how do so that the Quarter filter I have also applies to Month? Do I need to make 3 differnet filters formatted differently based on date? I would think that when you chose Q1 it would indirectly remove the months that aren't connected to this and vise versa. Why is all months still chosen when I have picked Q1 and Q2?

And another thing I am wondering about is how I can count x amount of rows that contain text? Something like

Sum(IF(IsNull(TextField),0,1))

I just don't know how do to it in Tableau and when I search you get so many answers it's hard to know what actually is for your own challenge.

Thanks for any help.

Best,

Ali A

• ###### 1. Re: Questions regarding filtering and count expression

Ali,

You need to select "Only Relevant Values" instead of "All values in Database" on the Month filters(see screenshot).

Then, when you choose Q1 in the quarter filter, only Jan, Feb and March will be shown (see below)..

Hope it helps.

Michael Ye

5 of 5 people found this helpful
• ###### 2. Re: Questions regarding filtering and count expression

Thank you!

Any tips on the expression?

Best,

Ali A

• ###### 3. Re: Questions regarding filtering and count expression

Ali,

Here I make a calculation to see how many rows which include "Aaron" in the customer name. Here, the number of rows is: 3.

{ FIXED [Customer Name]:(COUNT(IF CONTAINS([Customer Name],'Aaron') THEN 'Y' END)/COUNT([Customer Name]))}

Hope it helps.

Michael Ye

6 of 6 people found this helpful
• ###### 4. Re: Questions regarding filtering and count expression

Hmmm,

So I understand that one, but what if I want to make it depending on it i contains anything vs nothing. Could I eplace the IF Contains(CustomerName) with IsNull(CustomerName) ?

Thank you helping me so far.

Best,

Ali A

• ###### 5. Re: Questions regarding filtering and count expression

Hi Ali,

Yes, You can use the following calcs for counting the number of null customer name:

{ FIXED [ID]:(COUNT(IF ISNULL([Customer Name]) THEN 'Y' END))}

In the data source, D and F is null in user name, so the count is 2.

Hope it helps.

Michael Ye

5 of 5 people found this helpful