Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

mg862925
New Contributor

null count

I want to create a group for following value

I am going to use it as a filter with Yes or No (Swedish Ja/Nej)

if([ClaimId] like 'T48*','Ja',
if([ClaimId] like '=NullCount','Nej'))as Group1,

 

The T48 works

but I cant get the null to work

see my file 

Labels (3)
1 Solution

Accepted Solutions
rogerpegler
Contributor

Re: null count

If ClaimID can only start with T48 the Anil's suggestion slightly modified:

if(WildMatch(ClaimId, 'T48*'), 'Ja',  'Nej')as Group1

If there are other possible values then they should really be handled eg:

if(WildMatch(ClaimId, 'T48*'), 'Ja', if(Len(ClaimId)=0, 'Nej','Other')) as Group1

3 Replies
Highlighted
Mauritz_SA
Contributor III

Re: null count

Hi there

You can try something like:

if([ClaimId] like 'T48*','Ja',if(Len([ClaimId])=0 ,'Nej'))as Group1

If there is a chance that you can have spaces in the blank cells which you would also like to be treated as nulls then use the following:

if([ClaimId] like 'T48*','Ja',if(Len(Trim([ClaimId]))=0 ,'Nej'))as Group1

Good luck!

Mauritz

Re: null count

Perhaps this?

if(WildMatch(ClaimId, 'T48*'), 'Ja', if(IsNull(ClaimId), 'Nej'))as Group1

Or

if(WildMatch(ClaimId, 'T48*'), 'Ja', if(Len(ClaimId)=0, 'Nej'))as Group1

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
rogerpegler
Contributor

Re: null count

If ClaimID can only start with T48 the Anil's suggestion slightly modified:

if(WildMatch(ClaimId, 'T48*'), 'Ja',  'Nej')as Group1

If there are other possible values then they should really be handled eg:

if(WildMatch(ClaimId, 'T48*'), 'Ja', if(Len(ClaimId)=0, 'Nej','Other')) as Group1