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: 
bsbernabe
Creator
Creator

Count Null in 2 Field not equal

Hello There,

I have concern regarding how to count null in 2 fields, its like

=Count(Item_1)(SerialNo.1) not equal (Item_2)(SerialNo.2). See below sample data.

Item_1Serial_No.1Item_2Serial_No.2
R101138KSW10E016034R101138KSW10E016034
R101139KSW10E007333R101139KSW10E007333
R101150KYA10E003635-KYA10E003635
R101150KYA10E003505-KYA10E003505
R10069353S-038109R10069353S-038109
R100869G3C9E0031622-G3C9E0031622
R100870G3C9E0052369R100870G3C9E0052369
R100874G3E4E-0296585-G3E4E-0296585
R100905G3E3E0051832-G3E3E0051832
R100906E3U8E-0130086-E3U8E-0130086
R100907E3U8E-0133025R100907E3U8E-0133025

Best Regards,

Bing

3 Replies
vishsaggi
Champion III
Champion III

Not sure what is your expected output or if this is what you are looking for check below?

NullValues:

LOAD *, IF(Item_1_NullCount <> Item_2_NullCount, 1, 0) AS NullEqualCnt;

LOAD *, IF(Len(Trim(Item_1)) =0 OR Len(Trim(Serial_No.1)) =0, 0,1) AS Item_1_NullCount,

        IF(Len(Trim(Item_2)) =0 OR Len(Trim(Serial_No.2)) =0, 0,1) AS Item_2_NullCount INLINE [

Item_1, Serial_No.1, Item_2, Serial_No.2

R101138, KSW10E016034, R101138, KSW10E016034

R101139, KSW10E007333, R101139, KSW10E007333

R101150, KYA10E003635, , KYA10E003635

R101150, KYA10E003505, , KYA10E003505

R100693, 53S-038109 ,R100693, 53S-038109

R100869, G3C9E0031622, , G3C9E0031622

R100870, G3C9E0052369, R100870, G3C9E0052369

R100874, G3E4E-0296585, , G3E4E-0296585

R100905, G3E3E0051832, , G3E3E0051832

R100906, E3U8E-0130086, , E3U8E-0130086

R100907, E3U8E-0133025, R100907, E3U8E-0133025

];

bsbernabe
Creator
Creator
Author

Hi Vishwarath,

Thank you so much for your fast support actually what i want is to count all null at Item_2, that Serial_No.2 is equal  to Serial_No.1.

Regards,

Bing

keerthika
Creator II
Creator II

Hi,

    You can try this

    if(len(trim(Item_2)) = 1 and Serial_No.2=Serial_No.1 , 1,0) as nullitem

   

add the above condition in script and =count({<nullitem={1}>}nullitem) use this as expression