Qlik Community

Qlik Server Side Extensions Documents

Documents related to Server-Side Extensions and Advanced Analytics Integration.

Sample large no of IF Condition in script side

rajeshqvd
Contributor II

Sample large no of IF Condition in script side

IF((STL)='ANDAMAN AND NICOBAR ISLANDS','AN',

IF((STL)='ANDHRA PRADESH','AP',

IF((STL)='ARUNACHAL PRADESH','AR',

IF((STL)='ASSAM','AS',

IF((STL)='BIHAR','BR',

IF((STL)='CHANDIGARH','CH',

IF((STL)='CHHATTISGARH','CG',

IF((STL)='DADAR AND NAGAR HAVELI','DH',

IF((STL)='DAMAN AND DIU','DD',

IF((STL)='DELHI','DL',

IF((STL)='FOREIGNCOUNTRY','FC',

IF((STL)='GOA','GA',

IF((STL)='GUJARAT','GJ',

IF((STL)='HARYANA','HR',

IF((STL)='HIMACHAL PRADESH','HP',

IF((STL)='JAMMU AND KASHMIR','JK',

IF((STL)='JHARKHAND','JH',

IF((STL)='KARNATAKA','KA',

IF((STL)='KERALA','KL',

IF((STL)='LAKSHADWEEP','LD',

IF((STL)='MADHYA PRADESH','MP',

IF((STL)='MAHARASHTRA','MH',

IF((STL)='MANIPUR','MN',

IF((STL)='PONDICHERRY','PY',

IF((STL)='PUNJAB','PB',

IF((STL)='RAJASTHAN','RJ',

IF((STL)='TAMIL NADU','TN',

IF((STL)='TELANGANA','TS',

IF((STL)='TRIPURA','TP',

IF((STL)='UTTAR PRADESH','UP',

IF((STL)='UTTARAKHAND','UK',

IF((STL)='WEST BENGAL','WB')))))))))))))))))))))))))))))))) as ST

Tags (1)
Comments
mwoolf
Honored Contributor II

Why wouldn't you use a mapping table instead?

0 Likes
rajeshqvd
Contributor II

Yes we can mapping is the best practice but i did for large if condition  how can we do it

0 Likes
Version history
Revision #:
1 of 1
Last update:
‎2018-06-28 10:11 AM
Updated by: