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: 
Anonymous
Not applicable

Classifying nulls in a field based on another field

Hi All,

Please any help will be appreciated.

I am trying to Classify nulls in a field based on another field with below script:

LOAD
Rank,
If(Match(Rank, '1','2', '3'),'VP',
If(Match(Rank, '4', '5'),'Dir',
If(Match(Rank, '6','7'),'Mgrs', 
If(Match(Rank, '8', '9','10'),'Prof',
if(Match(EMP_TYP,'Reg','Temp ') and Rank = 'UNDEFINED','Undefined Emp',
if(Match(EMP_TYP,'CW') and Rank = 'UNDEFINED','Undefined CWs','UNDEFINED')))))) as [RANK DESC]
Resident EmployeeData;

Unsuccessful, because its taking all nulls count for each classification, instead of count for each classification.

Thanks & Regards

Neetha

10 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi Neetha,

Can you please explain with example. Like what you want and what you are getting. Sample file will be a good help

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
kkkumar82
Specialist III
Specialist III

Can you put some sample data here so that it will be easy for us.

As far as your condition you should get "undefined" if all conditions are false.

Kiran Kumar

Kushal_Chawda

Can you display what you are getting right now and what is expected?

Anonymous
Not applicable
Author

Hi All,

Please see sample data and application.

above script is working fine for sample data, but not for the real data.

Expected result for real data:

[Undefined Emp]  count : 6

[Undefined CWs]  count : 6

Actual result for real data:

[Undefined Emp]  count : 12

[Undefined CWs]  count : 12

For sample data it is working and for real data its not working.

why could that be?

Anonymous
Not applicable
Author

It works fine for your qvw & xls as far as I can see - see attached.

Maybe I am is understanding something.

Anonymous
Not applicable
Author

Hi Bill,

It works fine for my qvw & xls.

but the same logic for real data it's not working.

sample data is replicated exactly.

Thanks

Neetha

Anonymous
Not applicable
Author

Without being able to see the issue it is impossible to guess what is happening.

Anonymous
Not applicable
Author

Hi Bill,

I can't post real data

Thanks for trying to help.

Regards

Neetha

Anonymous
Not applicable
Author

Hi Neetha ,

Are there blank values also in the real data????

if so, first handle it as follows:

if(len(trim(Rank))=0,'Undefined',Rank) as RANK and

same for EMP_TYP.

Then use this in your [RANK DESC] for nested if conditions....

Regards

Nitin