Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
wanyunyang
Creator III
Creator III

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
JustinDallas
Specialist III
Specialist III

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
Specialist
Specialist

Try this -


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


Thanks.

shilpan
Partner Ambassador
Partner Ambassador

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
Creator III
Creator III

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
Specialist
Specialist

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

wanyunyang
Creator III
Creator III
Author

So IF function is my only choice?

wanyunyang
Creator III
Creator III
Author

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

wanyunyang
Creator III
Creator III
Author

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

JustinDallas
Specialist III
Specialist III

Why are you trying to avoid using "If"?