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: 
josemaria_cabre
Contributor III
Contributor III

Ignore filter in measure, but not in table

Hi,

Let's imagine this table:

measures are: sum(sales) and  count(distinct{<[type]={'sale'}>} name&surname)

1.png

If we apply filter 'refund' in dimension 'type', table transforms to this:

2.png

Is it possible to achieve this table, keeping  count distinct type='sale' calculation (3), but not showing 'sale' type rows in table, using some kind of set analysis?

namesurnametypeSum(sales)count(distinct{

<
[type]={'sale'}
>}
name&surname)
Total  -1503
johnsmithrefund-500
marybryantrefund-1000

 

 

 

 

 

 

LOAD * Inline [
name,surname,type,sales
john,smith,refund,-50
mary,bryant,refund,-100
arthur,jones,sale,150
brenda,patrick,sale,75
lisa,jackson,sale,50
];

 

 

Thanks in advance, 

Jose

Labels (3)
1 Solution

Accepted Solutions
tresesco
MVP
MVP

A tricky one.

tresesco_0-1594286631126.png

 

=If(Dimensionality()=0,
count(total distinct{<[type]={'sale'}>}name&surname),
count(distinct{<[type]*={'sale'}>}name&surname)
)

View solution in original post

4 Replies
tresesco
MVP
MVP

Do you really want to show the total '3' here or it should be '0'? If you are okay with keeping the total also varrying (to zero in this case), you could try like:

count(distinct{<[type]*={'sale'}>} name&surname)

josemaria_cabre
Contributor III
Contributor III
Author

Hi!

I'd like to show the total '3' (count distinct of type='sale') and sum(sales) = -150, but showing only records with 'refund' type in table

tresesco
MVP
MVP

A tricky one.

tresesco_0-1594286631126.png

 

=If(Dimensionality()=0,
count(total distinct{<[type]={'sale'}>}name&surname),
count(distinct{<[type]*={'sale'}>}name&surname)
)

josemaria_cabre
Contributor III
Contributor III
Author

Works great. Didn't know about this Dimensionality() function

Thanks a lot Tresesco!