Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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!
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.
Try this -
only({<Customer_No={1}>}Customer)
Thanks.
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.
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
Only({1<Customer_No={1}>}Customer)
So IF function is my only choice?
I have more than 1 customer with customer_no 1. This will return null.
I have more than 1 customer with customer_no 1. This will return null.
Why are you trying to avoid using "If"?