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: 
chris_gva
Contributor II
Contributor II

Exclude unwanted data in a column (pivot table)

Dear all,

Newby on Qlik sense, I am trying to exclude some dummy entries in my pivot.

In the example below, I would like to exclude see any "test" or "trial" entries.

I tried to add the following condition in the dimension condition "show the column if" : 
[Reference]<>'test' or [Reference] <>'trial'
the editor says the expression is fine (OK).

Example data :
Country|Reference|Quantity
Switzerland|test|20
Switzerland|GO1212|20
Switzerland|GO1111|45
Switzerland|trial|20
France|test|3
France|GM1215|2
France|GO1111|15
France|trial|45

thanks a lot for your help

Labels (1)
1 Solution

Accepted Solutions
brunobertels
Master
Master

Hi 

may be this 

aggr(if(match(Reference,'test','trial'),null,Reference),Reference)

View solution in original post

6 Replies
brunobertels
Master
Master

Hi 

may be this 

aggr(if(match(Reference,'test','trial'),null,Reference),Reference)

BrunPierre
Partner - Master
Partner - Master

Alternatively, this at the back end

TempData:
load * Inline [
Country,Reference,Quantity
Switzerland,test,20
Switzerland,GO1212,20
Switzerland,GO1111,45
Switzerland,trial,20
France,test,3
France,GM1215,2
France,GO1111,15
France,trial,45];

NoConcatenate
Data:
LOAD *
Resident TempData
Where not WildMatch(Upper(Reference),'*TEST*','TRIAL');
DROP Table TempData;

chris_gva
Contributor II
Contributor II
Author

I'll dive into this match function, but do I understand Qlik well if I do not have to use aggr here ? In my pivot the reference is used as a column dimension, hence no aggregation needed.

I'll let you know, at the moment all my trials are returning errors in the function editor...

 

Tks anyway 🙂

chris_gva
Contributor II
Contributor II
Author

Tks for the idea, this would be my last option.

Load of the data is done by another team, and this solution would oblige me to change the query if a new "fake" occurrence appear.

Having it solved by function, allow me to be more flexible :).

Cheers,

BrunPierre
Partner - Master
Partner - Master

If you're sticking to your approach then this

=IF([Reference]<>'test' and [Reference] <>'trial',[Reference])

Also, you'll have to suppress when the value is null.

peter_brown_0-1661512904358.png

 

brunobertels
Master
Master

Hi

Aggr is'nt necessary 

You can avoid it like this 

=if(not match(Reference,'*TEST*','TRIAL'),Reference)

Or

if(match(Reference,'*TEST*','TRIAL'),null(),Reference) 

see help page for understanding match not match mismatch function in QS