Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
debrouwer
Contributor II
Contributor II

Filter within a table

Hello,

Hopefully someone can help me with the following code...

I only want to filter and show the data of specific customers in a table. I believe this can be done by using IF Or IF(MATCH). Below you can find the code I have written so far, but I cannot get it to work. What should I adjust?

=if({<[Customer Sold-to Desc]="CustA","CustB">}[Customer Sold-to Desc],null())

debrouwer_1-1729855322386.png

debrouwer_0-1729854942569.png

It should show a - (null) if another customer is being displayed, and CustA or CustB if those customers generated sales. If I exclude null values, the table should only show the customers preselected in the code. At this point all customers are shown as - (null).

Hopefully someone can help me with this.

 

Thanks in advance.

 

Kind regards,

Pepijn

Labels (2)
5 Replies
Qrishna
Master
Master

if you are  trying to to create calculated dim then try:

=if(Match([Customer Sold-to Desc], 'CustA', 'CustB'), [Customer Sold-to Desc], null())

OR

=Aggr(Only({$<[Customer Sold-to Desc]={'CustA','CustB'}>}[Customer Sold-to Desc]),[Customer Sold-to Desc])

 

Measure: both should work

=Aggr(sum({$<[Customer Sold-to Desc]={'CustA','CustB'}>}Units),[list of your table dims])

=sum(Aggr(sum({$<[Customer Sold-to Desc]={'CustA','CustB'}>}Units),[list of your table dims]))

debrouwer
Contributor II
Contributor II
Author

Yes, I got it to work. But, can I somehow hide the column Customer Sold-to Desc now? Because I know what the customers shown are.

=if(match([Customer Sold-to Desc],'CustA','CustB'),[Customer Sold-to Desc])

Qrishna
Master
Master

yes. check the condition  property in the props and  insert 0.

debrouwer
Contributor II
Contributor II
Author

Can you show it with an image? I cannot seem to find it. I can hide the column by type "0" in Show column if, but then the used expression for the column deactivates as well...

Kushal_Chawda

@debrouwer  you can include set analysis condition in your measure "Not delivered unit" . Assuming your expression of that measure is sum(not_delivered_units). you can include set analysis condition as below

sum({<[Customer Sold-to Desc]={'CustA','CustB'}>}not_delivered_units)

If you have multiple measure, you need to include this set condition in all the measure of that table.

Then, in table properties Add-ons, uncheck "Include zero values" option