Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Highlighted
chiso_chiso
Contributor

Help with creating new dimension using like/not like

Guru,

I have a script as below;

if ( [Service] Like '*Admin*', 'Admin',

      if ( [Service] Like '*Complaint*', 'Complaint',

      if ( [Service] Like '*Claim*', 'Claim',

      if ( [Service]Like '*Sale*', 'Sale',

      if (not [Service] like ('*Sale*','*Admin*','*Complaint*','*Claim*')),'Other')))) as ServiceType

Apparently the 'Other' is not being created. Kindly assist

Tags (2)
6 Replies
MVP
MVP

Re: Help with creating new dimension using like/not like

Try

if ( [Service] Like '*Admin*', 'Admin',

      if ( [Service] Like '*Complaint*', 'Complaint',

           if ( [Service] Like '*Claim*', 'Claim',

               if ( [Service] Like '*Sale*', 'Sale', 'Other')))) as ServiceType

Re: Help with creating new dimension using like/not like

Try this may be:

If([Service] Like '*Admin*', 'Admin', If([Service] Like '*Complaint*', 'Complaint', If([Service] Like '*Claim*', 'Claim', If([Service] Like '*Sale*', 'Sale','Other')))) as ServiceType

chiso_chiso
Contributor

Re: Help with creating new dimension using like/not like

Thank you so much. It worked

sasiparupudi1
Honored Contributor III

Re: Help with creating new dimension using like/not like

= if ( lower([Service]) Like '*admin*', 'Admin', if ( lower([Service]) Like '*complaint*', 'Complaint', if ( lower([Service]) Like '*claim*', 'Claim', if ( lower([Service]) Like '*sale*', 'Sale', 'Other')))) as ServiceType

sasiparupudi1
Honored Contributor III

Re: Help with creating new dimension using like/not like

please close this thread by marking the correct answer

MVP
MVP

Re: Help with creating new dimension using like/not like

Another option

Pick(WildMatch(Service, '*Admin*', '*Complaint*', '*Claim*', '*Sale*') + 1, 'Other', 'Admin', 'Complaint', 'Claim', 'Sale')

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein