Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

wanyunyang
Contributor

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!

13 Replies
drillnaut
Valued Contributor

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.

isingh30
Contributor III

Re: Only show certain values

Try this -


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


Thanks.

shilpan9166
Contributor II

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.

clondono
Contributor III

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:

Load * Inline [

Customer_No, Customer

1, A

2, B

3, C

4, D

5, E

];


Load * Inline [


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

zebhashmi
Valued Contributor

Re: Only show certain values

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

wanyunyang
Contributor

Re: Only show certain values

So IF function is my only choice?

wanyunyang
Contributor

Re: Only show certain values

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

wanyunyang
Contributor

Re: Only show certain values

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

drillnaut
Valued Contributor

Re: Only show certain values

Why are you trying to avoid using "If"?