Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
chiso_chiso
Creator
Creator

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

Labels (1)
6 Replies
swuehl
Champion III
Champion III

Try

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

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

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

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

sunny_talwar
MVP
MVP

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
Creator
Creator
Author

Thank you so much. It worked

sasiparupudi1
Master III
Master III

= 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
Master III
Master III

please close this thread by marking the correct answer

jonathandienst
Partner - Champion III
Partner - Champion III

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