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

[QlikView] how to filter null in formula set analysis

hi everyone,

There are tow tables linked by key in the QVW file:

chenpeng_0-1752112288635.png

the data table and the chart showing as following:

chenpeng_1-1752112471237.png

I want to filter the dim table field [Movement_Cause_Code_Quartely_CP] not equal 1300.

however, the matrix can't calculate the result when the dim field no value matched (red rectangle cells).

I need how to modify my expression in EXP1 to let it work?

Thanks.

QlikView 

 

Labels (4)
1 Solution

Accepted Solutions
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

You cannot apply selections on nulls in Qlik (same applies to set analysis). 

The workaround would be:

  • to sum everything minus sum of what you want to exclude
    • Sum(Value)-Sum({<[Movement_Cause_Code_Quartely_CP] ={1300}>} Value)
cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.

View solution in original post

5 Replies
Chanty4u
MVP
MVP

Try this 

LOAD *,

    If(IsNull([Movement_Cause_Code_Quartely_CP]), 'Null', [Movement_Cause_Code_Quartely_CP]) as MC_Code_Clean

Resident DimTable;

And in expression 

Sum({<MC_Code_Clean -= {'1300'}>} YourMeasureField)

 

QFabian
MVP
MVP

Hi @chenpeng , try this mixed expression between some tradicional IF and Set Analysis

EXP1.1 :

sum(if([Movement_Cause_Code_Quarterly_CP] <> 1300,
{<Model_CD = {'Trad'}, Method -= {'PAA'} >} Value))

 

QFabian_0-1752272281265.png

 

QFabian
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

You cannot apply selections on nulls in Qlik (same applies to set analysis). 

The workaround would be:

  • to sum everything minus sum of what you want to exclude
    • Sum(Value)-Sum({<[Movement_Cause_Code_Quartely_CP] ={1300}>} Value)
cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
chenpeng
Contributor II
Contributor II
Author

Hi Miszk,

Thanks for you confirmation! The approach you mentioned it work properly. I already find this solution before I post the question, I just want to find there is any simple/clear expression can meet the requirement.

have a nice day!

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

I dont think there is better solution as your data is just not associated at this stage. For nicer solution you would need to make changes to your data model, join both tabels and likely populate nulls with selectable values.

cheers

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.