Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Shaglok
Contributor III
Contributor III

Create groups.

Hello everybody. First of all, excuse my English. I am from Argentina.

I am developing an app to track the usage of the networks of an online shop. Our CRM allow us to add tags to every conversation and we use them to locate the topics, etc, of our interactions. That's working fine.

Now, we want to use these tags in groups to get more information. The company wants to add a communication style defined by several things. For example, we always want to salute , say goodbye to the clients, answer their question and (optionally) send them extra information. I will be clearer with examples. Here is how I charge the tags into Qlik:

//loading relevant tags
wildmatch(`tags`, '*Extra Info') AS tag_extra_info,
wildmatch(`tags`, '*Bye') AS tag_bye,
wildmatch(`tags`, '*Question*') AS tag_ask,
wildmatch(`tags`, '*Conclustion*') AS tag_conclusion,
wildmatch(`tags`, '*private*') AS tag_hello_private,
wildmatch(`tags`, '*public*') AS tag_hello_public,

That way, the tags "Extra Info", "Bye", "Question", "Conclusion" and both welcome messages (in public and in private) are available into Qlik.

Now, to define that we use the communication style we want, we need to have into every private conversation the private hello and the bye as mandatory and as optional any of the others. To do that, I did this:

// private comm style
IF(wildmatch(`tags`, '*private')
AND wildmatch(`tags`, '*bye*')
AND wildmatch(`tags`, '*Extra Info')
OR wildmatch(`tags`, '*Conclusion')
OR wildmatch(`tags`, '*Question*')
, 'Private Style) AS private_style,

But I am having weid results. I am getting conversations with the new "private_style" field as 1, but if I monotirize them, not all the tags are there. And if I change the order of the AND's I receive diferent results, which should not be possible, talking about required tags.

And here is my question. How can I create groups based on tags that I already have charged and working? I though in doing them with Set Analysis, but I couln'd find how to do it with OR, and some of them are optional.

I appreciate any help.

Labels (2)
2 Replies
micheledenardi
Specialist II
Specialist II

Can you please share some example data and the wanted result? Thanks

Michele De Nardi
If a post helps to resolve your issue, please accept it as a Solution.
vchuprina
Specialist
Specialist

Hi,

Right now, you have 3 groups of conditions

// private comm style
IF(wildmatch(`tags`, '*private')
AND wildmatch(`tags`, '*bye*')
AND wildmatch(`tags`, '*Extra Info')
OR wildmatch(`tags`, '*Conclusion')
OR wildmatch(`tags`, '*Question*')
, 'Private Style) AS private_style,

First group:

IF(wildmatch(`tags`, '*private')
AND wildmatch(`tags`, '*bye*')
AND wildmatch(`tags`, '*Extra Info')

Second group:

OR wildmatch(`tags`, '*Conclusion')

Third group:

OR wildmatch(`tags`, '*Question*')

This group doesn’t work at all because wildmatch(`tags`, '*private') and wildmatch(`tags`, '*Extra Info') conflict with each other. You use ‘*private’ and ‘*Extra Info’, so your tag string should finish by ‘private’ and ‘Extra Info’ at the same time and it’s not possible.

The second and third groups work fine, so every tag string with Conclusion at the end of the string or Question in any part of the string will be determined as ‘Private Style’

First, you should decide where Key word should be.

‘*bye*’ – true if bye is in the string

‘*bye’ – true if bye at the end of the string

‘bye*’ – true if the string starts from bye

‘bye’ – true if the string contains only bye

Then you should use parentless to change groups of conditions according to your needs.

For instance, I added parentless after the second ‘AND’ and know I have only two groups.

IF(wildmatch(`tags`, '*private*')

AND wildmatch(`tags`, '*bye*')

AND (wildmatch(`tags`, '*Extra Info')

     OR wildmatch(`tags`, '*Conclusion')

     OR  wildmatch(`tags`, '*Question*'))

, 'Private Style') AS private_style,

Qlik will return ‘Private Style’ when the 'tags' field contains ‘private’ and ‘bye’ keywords and finishes with ‘Extra Info’ or ‘Conclusion’ or contains ‘Question’.

Hope it’s helpful.

Regards,

Vitalii  

Press LIKE if the given solution helps to solve the problem.
If it's possible please mark correct answers as "solutions" (you can mark up to 3 "solutions").