Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
mapratt82
Creator
Creator

If Statement, is there a better way?

I'm working on transaction data to find customer paying competitors. The data isn't straight forward, so I've had to find common characteristics that I can match on to decipher who the payment is going too. This has led to a moderately long if statement with more needing added. I need a better alternative as with this being transaction data includes millions of lines of data, thus with the If Statements makes it even slower and clunkier. Thanks!

if(WildMatch(Notes, 'Regions*'), 'Regions Bank',

if(WildMatch(Notes, '*Suntrust*'), 'Suntrust Bank',

if(WildMatch(Notes, 'Redstone F*'), 'Redstone Federal Credit Union',

if(WildMatch(Notes, 'Family Security *'), 'Family Security Credit Union',

if(WildMatch(Notes, 'Community Spirit *'), 'Community Spirit Bank',

if(WildMatch(Notes, 'Valley Credit *'), 'Valley Credit Union',

if(WildMatch(Notes, 'Valley State *'), 'Valley State Bank',

if(WildMatch(Notes, 'First Metro *'), 'First Metro Bank',

if(WildMatch(Notes, 'BBVA *','BBVACompass*'), 'BBVA/Compass Bank',

if(WildMatch(Notes, 'BB and T *', 'BB&T *', 'BBT_*'), 'BB&T Bank',

if(WildMatch(Notes, 'Barclay Card*','Barclaycard*','Barclays Bank De Transfer*'), 'Barclays US',

if(WildMatch(Notes, 'Bank of the West*', 'Bankofthewest*'), 'Bank of the West',

if(WildMatch(Notes, 'Bank of Ozarks*','Bankoftheozarks*'), 'Bank of the Ozarks',

if(WildMatch(Notes, 'Lister Hill*', 'Listerhil*'), 'Listerhill Credit Union',

if(WildMatch(Notes, 'Bancorpsouth*'), 'BancorpSouth Bank',

if(WildMatch(Notes, 'Discover*'), 'Discover',

if(WildMatch(Notes, 'Ally*') and not WildMatch(Notes,'*Paypal*'),'Ally Bank',

if(WildMatch(Notes, 'Bank Independent*'), 'Bank Independent'))))))))))))))))))

10 Replies
mapratt82
Creator
Creator
Author

Finally was able to open and this works great! I actually have 6 variables I'm using in place of ifStatements and/or pick(match()). Everything works correctly and I did see some performance increase. Unfortunately I'm loading 7-8 million row and then doing an aggr calculation on that table which ends up being around 6 million rows, so it does take longer than I would like to load. I've also noticed on my dashboards that where I'm using more granular data that it takes much longer to load. Does anyone have any suggestions? I would like to improve this, as I'm only pulling 6 months worth of data and would like to ramp that up to a rolling 12. Thanks everyone for your help!