Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how to filte dimension values

I have a dimention (vendor name: A, B, C, D, ...., Z) and Payments. We are only interested on some vendors and their payemns. So i have selected VendorName as my dimention, and sum(payments) as an expression. Since we are interested on only vendors: B, D. how do i apply a filter or where clause on dimention values.

I have tried the following conditions on dimension but it did not help.

=(VendorName='B' OR VendorName='D')

= If(VendorName='B' OR VendorName='D', VendorName, NULL())

I tried apply the filter on expression but I am getting  one row insted of two rows (one row per vendor) like

VendorName     Sumof Payment      ----- apply a filter on expression

     D                         30000

VendorName     Sum of Payment  --- I would like to see like this.

     B                         10000

     D                        20000

Thanks for your time.

1 Solution

Accepted Solutions
chematos
Specialist II
Specialist II

Could you try this? Both options are working for me.

Expression-> Sum({<VendorName={'B,D'}>} Payment)

Dimension-> If(VendorName='B',VendorName,If(VendorName='D', VendorName))

Regards.

View solution in original post

3 Replies
jvitantonio
Luminary Alumni
Luminary Alumni

You should place your if statement

= If(VendorName='B' OR VendorName='D', VendorName, NULL())

in the dimension section. If you only see D as a result, it's because youonly have values for D.

If this is not the case please paste your application with sample data so we can work on it.


Not applicable
Author

I did test both scenarios 1. apply the filter on dimension level , 2. at expression level. unfortunately both options did not provide me what i was looking for.. Hear is my test data and I would like to see

VendorName     Payment

      A                      300

      B                      400

Pleas let me know if you have any questions.

Thanks.

chematos
Specialist II
Specialist II

Could you try this? Both options are working for me.

Expression-> Sum({<VendorName={'B,D'}>} Payment)

Dimension-> If(VendorName='B',VendorName,If(VendorName='D', VendorName))

Regards.