13 Replies Latest reply: Feb 26, 2018 7:46 PM by Thiago Justen Teixeira

# Only show certain values

Hi guys,

I have a table with columns named Customer_No and Customer. If I only want to show the customers with Customer_No=1, can I use set analysis instead of IF function?

I tried ({<Customer_No={'1'}>}Customer), it doesn't work.

Thanks for help!

• ###### Re: Only show certain values

If the column you are trying to hide stuff in is a Dimension, then you should be able to do something like this.

If( Customer_No = 1, Customer )

Then, in your Dimension declaration on the right-hand side, you select to hide nulls.

• ###### Re: Only show certain values

Set Analysis only works with an aggregation (Sum, Count, etc)

For instance if you have these two inline tables in your load statement:

Customer_No, Customer

1, A

2, B

3, C

4, D

5, E

];

Order_No, Customer_No, Sales

1, 4, 100

2, 4, 99

3, 1, 1000

4, 2, 100

5, 1, 250

6, 3, 500

];

Yo want to see only sales for Customer_No 1, you can create a table with Customer as dimension and the following for your calculated field:

Sum({<Customer_No={1}>}Sales)

It will show sales for only customer 1

• ###### Re: Only show certain values

So IF function is my only choice?

• ###### Re: Only show certain values

Why are you trying to avoid using "If"?

• ###### Re: Only show certain values

I'm just trying to do it both with IF and set analysis.

• ###### Re: Only show certain values

Try this -

only({<Customer_No={1}>}Customer)

Thanks.

• ###### Re: Only show certain values

I have more than 1 customer with customer_no 1. This will return null.

• ###### Re: Only show certain values

It should work if you are not using it as a calculated dimension. Instead use it as an expression like this

Dimension: Customer

Expression: only({<Customer_No={'1'}>}Customer)

Set Analysis syntax always requires an aggregation function.

• ###### Re: Only show certain values

Only({1<Customer_No={1}>}Customer)

• ###### Re: Only show certain values

I have more than 1 customer with customer_no 1. This will return null.

• ###### Re: Only show certain values

Edited

I did not get it

Concat(Only({1<Customer_No={1}>}Customer),',')

• ###### Re: Only show certain values

I think that in this case; to handle this one to many rrelation; you'll have to use if condition.

stalwar1, do u confirm?

or maybe construct ur filter as follow: (not sure it'll work)

=aggr(only({<customer_no ={1}>}customer ),customer)