Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

abhonsle
New Contributor III

Help with understanding this code

Hi All,

I am new to QlikSense and I am trying to understand this code. Can you help:

    If((WildMatch([Lead_Status_Reason__c], '*Do Not Contact*','*Duplicate*','*Incorrect Contact Info*','*Wrong*','*Reseller*') = 0 and

   

     Match([Lead_Status__c],'7. Closed')=1 ),'legit close',

If (WildMatch([Lead_Status__c],'*Nurture*','*Qualified*','*Sales*') = 0,

   

     If(WildMatch([Lead_Status_Reason__c], '*Do Not Contact*','*Duplicate*','*Incorrect Contact Info*','*Wrong*','*Reseller*') = 0 and

   

     Lead_Status__c <>'0. Outbound Call List','Legit','Rejected'),'past MR')) AS LM_TAL_Flag,

What happens if  LM_TAL_Flag -= {'Rejected'} ?

1 Solution

Accepted Solutions
ahaahaaha
Honored Contributor

Re: Help with understanding this code

Hi,

Suppose we analyze the current record of a table with many fields. A new field [LM_TAL_Flag] is added

If((WildMatch([Lead_Status_Reason__c], '*Do Not Contact*','*Duplicate*','*Incorrect Contact Info*','*Wrong*','*Reseller*') = 0 and

    Match([Lead_Status__c],'7. Closed')=1 ),'legit close',


1) Checked condition: If in the value of field [Lead_Status_Reason__c], regardless of the case of letters, there are not fragments of the listed text (Do Not Contact etc.) and in the value of field [Lead_Status__c], with the case of the letters, there a text (7. Closed) is the first, the value of field [LM_TAL_Flag] is 'legit close'. Otherwise



If (WildMatch([Lead_Status__c],'*Nurture*','*Qualified*','*Sales*') = 0,


2) The following condition is verified: in the value of field [Lead_Status__c], regardless of the case of letters, there are not fragments of the listed text (Nurture etc.). If the condition is fulfilled, then the following conditions are checked, otherwise the field [LM_TAL_Flag] takes the value 'past MR'.

  If(WildMatch([Lead_Status_Reason__c], '*Do Not Contact*','*Duplicate*','*Incorrect Contact Info*','*Wrong*','*Reseller*') = 0 and

    Lead_Status__c <>'0. Outbound Call List','Legit','Rejected'),'past MR')) AS LM_TAL_Flag,

3) Checked condition: If in the value of field [Lead_Status_Reason__c], regardless of the case of letters, there are not fragments of the listed text (Do Not Contact etc.) and value of field [Lead_Status__c] not equal '0. Outbound Call List'. If the condition is fulfilled, then the field [LM_TAL_Flag] takes the value 'Legit', otherwise 'Rejected'. It should be emphasized that condition 3) is checked only if condition 2).


It is difficult to answer question "What happens if  LM_TAL_Flag -= {'Rejected'} ?", we just do not see your data.

I explained how I could, I hope it's clear :-)


Regards,

Andrey



2 Replies
Not applicable

Re: Help with understanding this code

Hi Ajinkya,

As per the code that you have posted, you should either get 'legit close' or 'past MR' as dimension values for LM_TAL_FLAG. So as per your code, you will never get 'Rejected' as value under LM_TAL_FLAG.

Coming back to the question, LM_TAL_Flag -= {'Rejected'} would yield you all the data where LM_TAL_FLAG={'legit close','past MR'}



Regards,

Shashidhar Nadiger

ahaahaaha
Honored Contributor

Re: Help with understanding this code

Hi,

Suppose we analyze the current record of a table with many fields. A new field [LM_TAL_Flag] is added

If((WildMatch([Lead_Status_Reason__c], '*Do Not Contact*','*Duplicate*','*Incorrect Contact Info*','*Wrong*','*Reseller*') = 0 and

    Match([Lead_Status__c],'7. Closed')=1 ),'legit close',


1) Checked condition: If in the value of field [Lead_Status_Reason__c], regardless of the case of letters, there are not fragments of the listed text (Do Not Contact etc.) and in the value of field [Lead_Status__c], with the case of the letters, there a text (7. Closed) is the first, the value of field [LM_TAL_Flag] is 'legit close'. Otherwise



If (WildMatch([Lead_Status__c],'*Nurture*','*Qualified*','*Sales*') = 0,


2) The following condition is verified: in the value of field [Lead_Status__c], regardless of the case of letters, there are not fragments of the listed text (Nurture etc.). If the condition is fulfilled, then the following conditions are checked, otherwise the field [LM_TAL_Flag] takes the value 'past MR'.

  If(WildMatch([Lead_Status_Reason__c], '*Do Not Contact*','*Duplicate*','*Incorrect Contact Info*','*Wrong*','*Reseller*') = 0 and

    Lead_Status__c <>'0. Outbound Call List','Legit','Rejected'),'past MR')) AS LM_TAL_Flag,

3) Checked condition: If in the value of field [Lead_Status_Reason__c], regardless of the case of letters, there are not fragments of the listed text (Do Not Contact etc.) and value of field [Lead_Status__c] not equal '0. Outbound Call List'. If the condition is fulfilled, then the field [LM_TAL_Flag] takes the value 'Legit', otherwise 'Rejected'. It should be emphasized that condition 3) is checked only if condition 2).


It is difficult to answer question "What happens if  LM_TAL_Flag -= {'Rejected'} ?", we just do not see your data.

I explained how I could, I hope it's clear :-)


Regards,

Andrey