Skip to content
+1-888-319-3663

COMMUNITY FORUM

Using Case Statement in Additional Column

Jessica asked 7 years ago
I’m trying to add a case statement to an additional column in SmartConnect.
The looking up the 1099 part works great, however, I needed to add a case statement that if the 1099 doesn’t equal one and the DistributionReference column contains the following text, then return the Document Amount, otherwise, return 0. 
Any help would be appreciated!
if _TEN99TYPE<>1
THEN
Select Case _DISTRIBUTIONREF
Case _DISTRIBUTIONREF.trim()=“Pay”
Return _DOCAMOUNT
Case _DISTRIBUTIONREF.trim()=“Bonus”
Return _DOCAMOUNTCase _DISTRIBUTIONREF.trim()=”Fee Deduction”
Return _DOCAMOUNTCase _DISTRIBUTIONREF.trim()=“Gas”
Return _DOCAMOUNT
End Select
else
return 0
END IF
Answers
Jessica answered 7 years ago
To those who’ve looked at this, here is the answer:
if _TEN99TYPE<>1 THEN 
Select Case _DISTRIBUTIONREF.trim()
                                Case “Pay”, “Bonus”, “Fee Deduction”, “Gas”
Return _DOCAMOUNT    
Case Else
Return 0
                End Select
Else
return 0  
END IF

If you would like to submit an answer or comment, please sign in to the eOne portal.