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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

HELP ME WITH THE SCRIP ISSUE

  Please help me with the below expression if I am doing anything wrong here.

sum (IF([Source Code]='NFSC' ,
         IF(SECR_LVL_CD_1 <> 'INSURANCE',
           IF(SECR_LVL_CD_1 <> 'ANNUITY',
             IF(SECR_LVL_CD_1 <> 'ANNUITIES',
               IF(SecondTransactonTypeCode='FEE'))))),[GL Post Amount] * (alt([Partnership Percent],1)))

1 Solution

Accepted Solutions
pgrenier
Partner - Creator III
Partner - Creator III

Good day,

One thing is for sure, you can easily simplify your expression:

Sum(If([Source Code]='NFSC' and Match([SECR_LVL_CD_1], 'INSURANCE','ANNUITY','ANNUITIES')=0 and SecondTransactonTypeCode='FEE', [GL Post Amount] * alt([Partnership Percent],1) ,0))

Regards,

Philippe

View solution in original post

7 Replies
Carlos_Reyes
Partner - Specialist
Partner - Specialist

You're missing the action to be performed when all those if's come true:

sum (IF([Source Code]='NFSC' ,
         IF(SECR_LVL_CD_1 <> 'INSURANCE',
           IF(SECR_LVL_CD_1 <> 'ANNUITY',
             IF(SECR_LVL_CD_1 <> 'ANNUITIES',
               IF(SecondTransactonTypeCode='FEE',  HERE YOU MUST PLACE WHAT YOU WANT TO TO , AND HERE YOU MUST PLACE THE ELSE))))),[GL Post Amount] * (alt([Partnership Percent],1)))


pgrenier
Partner - Creator III
Partner - Creator III

Good day,

One thing is for sure, you can easily simplify your expression:

Sum(If([Source Code]='NFSC' and Match([SECR_LVL_CD_1], 'INSURANCE','ANNUITY','ANNUITIES')=0 and SecondTransactonTypeCode='FEE', [GL Post Amount] * alt([Partnership Percent],1) ,0))

Regards,

Philippe

Not applicable
Author

You need to use SetAnalysis like this, and avoid to use alt function.


sum ({$<     [Source Code]={'NFSC' },
                   SECR_LVL_CD_1-={'INSURANCE','ANNUITY','ANNUITIES'},
                    SecondTransactonTypeCode={'FEE'}

          >}


[GL Post Amount] )


* alt([Partnership Percent],1)

stabben23
Partner - Master
Partner - Master

Hi, this is syntax, BUT you will have multiple hits in your if statment.

sum (IF([Source Code]='NFSC' ,
         IF(SECR_LVL_CD_1 <> 'INSURANCE',
           IF(SECR_LVL_CD_1 <> 'ANNUITY',
             IF(SECR_LVL_CD_1 <> 'ANNUITIES',
                 IF(SecondTransactonTypeCode='FEE',[GL Post Amount] * (alt([Partnership Percent])),1))))))

Not applicable
Author

Thank you very much.

Not applicable
Author

Set analysis is coming up with syntax error for not equal.

Not applicable
Author

That is not an error, its just the QlikView error check.