Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All ,
I have a table in it there is a field by name City which has some errors needs to be replaced , Below is the wildmatch iam tryong to use but i think iam wrong somewhere . I want the city name to be replaced as i have described and other than that it should display all the CITY name as it is , and iam trying to create a new field by name cit. Pleas elet me know where iam wrong , This is loading but npt giving any error .Through some light on this
City:
LOAD CITY,
if(WildMatch(CITY,'BETHLEHT*'),'BETHELEHM') ,
if(WildMatch(CITY,'ZION HI*'),'ZIONHILL') ,
if(WildMatch(CITY,'SCOTT TW*'),'SCOTT TOWNSHIP') ,
if(WildMatch(CITY,'SCHUYKL HAV*'),'SCHUYLKILL HAVEN') ,
// if(WildMatch(CITY,'S ABINGTN TWP*'),'S ABINGTON TWP'),
if(WildMatch(CITY,'NEWBUR*'),'NEWBURG'),
if(WildMatch(CITY,'NEW RING*'),'NEW RINGGOLD'),
if(WildMatch(CITY,'MT BETH*'),'MOUNT BETHEL'),
if(WildMatch(CITY,'LAURY*'),'LAURYS STATION'),
if(WildMatch(CITY,'JERY*'),'JERMYN'),
if(WildMatch(CITY,'HONEYBRO*'),'HONEY BROOK'),
if(WildMatch(CITY,'HAZLE TOWNS*'),'HAZLE TOWNSHIP'),
if(WildMatch(CITY,'EGG HBR*'),'EGG HARBOR TWP'),
if(WildMatch(CITY,'EAST STROUDSBUR*'),'EAST STROUDSBURG'),
if(WildMatch(CITY,'DOYLETOW*'),'DOYLESTOWN'),
if(WildMatch(CITY,'CHARLESTO*'),'CHARLES TOWN'),
if(WildMatch(CITY,'CATASAQ*'),'CATASAUQUA'),
if(WildMatch(CITY,'BREININGSVI*'),'BREINIGSVILLE'),
if(WildMatch(CITY,'BOYTON BE*'),'BOYNTON BEACH'),
if(WildMatch(CITY,'BOILING SPN*'),'BOILING SPRINGS'),
if(WildMatch(CITY,'SPRNG BRK*'),'SPRING BROOK TWP'),
if(WildMatch(CITY,'PHILA*'),'PHILADELPHIA'),
if(WildMatch(CITY,'S ABINGT*'),'S ABINGTON TWP'),
//if(WildMatch(CITY,'SCHUYKL HAV*'),'SCHUYLKILL HAVEN'),
if(WildMatch(CITY,'NEW PHIL*'),'NEW PHILADELPHIA'), CITY AS cit,
The trick of ELSE part here:
Pick(wildmatch(City, 'A1*', 'B1*' , 'C1*', 'D1*', 'E1*' , 'F1*')+1, City, 'A', 'B', 'C', 'D', 'E', 'F') as [Transaction Type]
Hi,
Use pick Wildmatch in this case.
Ex: Pick(wildmatch([Type], 'A1*', 'B1*' , 'C1*', 'D1*', 'E1*' , 'F1*'), 'A', 'B', 'C', 'D', 'E', 'F') as [Transaction Type]
Hi,
You have syntax error
modify your if statement
like
if(wildmatch(City,'BETHLEHT*'),'BETHELEHM',
if(wildmatch(City,'ZION HI*'),'ZIONHILL',City
)) as newCity
check closing bracket also for more details see if else in help menu
Regards
Hi,
Try like this using Pick() and WildMatch(), it is bit easier when compared to Nested IF()
=Pick(WildMatch(CITY,'BETHLEHT*', 'ZION HI*', 'SCOTT TW*'), ...........................
'BETHELEHM',
'ZIONHILL',
'SCOTT TOWNSHIP', .................................)
Hope this helps you.
Regards,
jagan.
Ji jagan ,
Please find the attachment i tried the abive expression even replaced by and yet its not working
Hi Tamil rajan beside this it has to pic CITY , that is else CITY
Hi John,
Try this..
Load City,
if(WildMatch(City,'BETHLEHT*'),'BETHELEHM',
if(WildMatch(City,'ZION HI*'),'ZIONHILL' ,
if(WildMatch(City,'SCOTT TW*'),'SCOTT TOWNSHIP' ,
if(WildMatch(City,'SCHUYKL HAV*'),'SCHUYLKILL HAVEN' ,
// if(WildMatch(City,'S ABINGTN TWP*'),'S ABINGTON TWP'),
if(WildMatch(City,'NEWBUR*'),'NEWBURG',
if(WildMatch(City,'NEW RING*'),'NEW RINGGOLD',
if(WildMatch(City,'MT BETH*'),'MOUNT BETHEL',
if(WildMatch(City,'LAURY*'),'LAURYS STATION',
if(WildMatch(City,'JERY*'),'JERMYN',
if(WildMatch(City,'HONEYBRO*'),'HONEY BROOK',
if(WildMatch(City,'HAZLE TOWNS*'),'HAZLE TOWNSHIP',
if(WildMatch(City,'EGG HBR*'),'EGG HARBOR TWP',
if(WildMatch(City,'EAST STROUDSBUR*'),'EAST STROUDSBURG',
if(WildMatch(City,'DOYLETOW*'),'DOYLESTOWN',
if(WildMatch(City,'CHARLESTO*'),'CHARLES TOWN',
if(WildMatch(City,'CATASAQ*'),'CATASAUQUA',
if(WildMatch(City,'BREININGSVI*'),'BREINIGSVILLE',
if(WildMatch(City,'BOYTON BE*'),'BOYNTON BEACH',
if(WildMatch(City,'BOILING SPN*'),'BOILING SPRINGS',
if(WildMatch(City,'SPRNG BRK*'),'SPRING BROOK TWP',
if(WildMatch(City,'PHILA*'),'PHILADELPHIA',
if(WildMatch(City,'S ABINGT*'),'S ABINGTON TWP',
//if(WildMatch(City,'SCHUYKL HAV*'),'SCHUYLKILL HAVEN'),
if(WildMatch(City,'NEW PHIL*'),'NEW PHILADELPHIA'))))))))))))))))))))))) as New_City
Hi,
Instead of these much if, You can use the ApplyMap..
It is easy to maintain..
Sample attached
Try like below,
Pick(wildmatch([Type], 'A1*', 'B1*' , 'C1*', 'D1*', 'E1*' , 'F1*') +1 , 'A', 'B', 'C', 'D', 'E', 'F', 'No Match') as [Transaction Type]
In your case CITY (No single quotes around the CITY)
The trick of ELSE part here:
Pick(wildmatch(City, 'A1*', 'B1*' , 'C1*', 'D1*', 'E1*' , 'F1*')+1, City, 'A', 'B', 'C', 'D', 'E', 'F') as [Transaction Type]