Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

If match Error in logic troubleshooting

if ( (match([D Investor],'FNMA','FHLMC','FHA') ,
   
if (match([Product Type],'MOD24','APOLLO','ALT2011','ALTMOD','CAPMOD','HUDMOD','HUDPCLM'),'N'),
    

if( (match([D Investor],'FNMA') and match([Product Type],'HMP') and [Last FTPMBM Date] >= [Setup Date]) or
      (
match([D Investor],'SunTrust') and match([Product Type],'HMP') and [Last FTPMBM Date] >= [Setup Date]) or
       
match([D Investor],'VA','PRIVATE / REG AB')  or
        
match([D Investor],'FHA') and Match([Product Type],'FHAHAMP')))), 'Y', as [IDI] ,

I get an error where the red comma is located right after FHA.  My objective here is show an ‘N’ or a ‘Y’ based on the above referenced logic.  The red comma is my only error.  Am I not enclosing a bracket in the correct place

1 Solution

Accepted Solutions
sunny_talwar

Is there a extra parenthesis after the very first if?

if ( (match([D Investor],'FNMA','FHLMC','FHA') ,
   
if (match([Product Type],'MOD24','APOLLO','ALT2011','ALTMOD','CAPMOD','HUDMOD','HUDPCLM'),'N'),
   

if( (match([D Investor],'FNMA') and match([Product Type],'HMP') and [Last FTPMBM Date] >=[Setup Date]) or
      (
match([D Investor],'SunTrust') and match([Product Type],'HMP') and [Last FTPMBM Date] >= [Setup Date]) or
       
match([D Investor],'VA','PRIVATE / REG AB')  or
       
match([D Investor],'FHA') and Match([Product Type],'FHAHAMP')))), 'Y', as [IDI]


I may be totally wrong, but to me it seems that only one is required.


Best,

S

View solution in original post

3 Replies
sunny_talwar

Is there a extra parenthesis after the very first if?

if ( (match([D Investor],'FNMA','FHLMC','FHA') ,
   
if (match([Product Type],'MOD24','APOLLO','ALT2011','ALTMOD','CAPMOD','HUDMOD','HUDPCLM'),'N'),
   

if( (match([D Investor],'FNMA') and match([Product Type],'HMP') and [Last FTPMBM Date] >=[Setup Date]) or
      (
match([D Investor],'SunTrust') and match([Product Type],'HMP') and [Last FTPMBM Date] >= [Setup Date]) or
       
match([D Investor],'VA','PRIVATE / REG AB')  or
       
match([D Investor],'FHA') and Match([Product Type],'FHAHAMP')))), 'Y', as [IDI]


I may be totally wrong, but to me it seems that only one is required.


Best,

S

Not applicable
Author

That worked.  Let me ask is there a best practices way to analyze when to and not to insert the brackets. That is the area that is the most challenging

sunny_talwar

Its not an exact science. Every time you open a parenthesis you need to close it, but in case you put too many or too less parenthesis, QlikView will give you an error

I wish there was an easy way out.

Best,

S