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

If Not Match Question

Hi,

I am trying to omit "Remaining Retail" and "Total Retail". I have the expression below, but my data is showing a dash mark (very bottom row), with the total sales. I want to remove that. How do I do that?

=if(not match(Outlet, 'Total Retail', 'Remaining Retail'), Outlet)

KPage_0-1693322640506.png

 

Labels (3)
1 Solution

Accepted Solutions
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Well, the reason for the NULL value is the essence of the formula - it uses the fields with no aggregation, hence at the total row all possible values of the field Outlet are possible, while the formula is expecting a single value.

Also, solving this issue in a calculated Dimension is quite wasteful - it adds unnecessary overhead, which could be substantial in large data sets.

So, a better solution would be to resolve it in the Measure, using Set Analysis, for example like this:

sum({<Outlet -= { 'Total Retail', 'Remaining Retail'}>}  Sales) 

With this measure, the Dimension can be simply "Outlet", with no IF conditions.

To learn more advanced development techniques, check out the agenda of the Masters Summit for Qlik - coming soon to Orlando and to Dublin! I'm teaching solutions like this one in my session on Set Analysis and AGGR.

View solution in original post

3 Replies
Digvijay_Singh

Check if this property helps - 

Digvijay_Singh_0-1693324184909.png

 

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Well, the reason for the NULL value is the essence of the formula - it uses the fields with no aggregation, hence at the total row all possible values of the field Outlet are possible, while the formula is expecting a single value.

Also, solving this issue in a calculated Dimension is quite wasteful - it adds unnecessary overhead, which could be substantial in large data sets.

So, a better solution would be to resolve it in the Measure, using Set Analysis, for example like this:

sum({<Outlet -= { 'Total Retail', 'Remaining Retail'}>}  Sales) 

With this measure, the Dimension can be simply "Outlet", with no IF conditions.

To learn more advanced development techniques, check out the agenda of the Masters Summit for Qlik - coming soon to Orlando and to Dublin! I'm teaching solutions like this one in my session on Set Analysis and AGGR.

KPage
Contributor III
Contributor III
Author

That worked! Thank you so much!