Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
My requirement is to create a field and categorize into 2 -Category 1 and Category 2.
1)If Code starts with alphabets then
1.1)if it belongs to Product Group K01 ,it is categorized as Category 1
1.2) if it belongs to Product Group K05 ,it is categorized as Category 2
2)If Code starts with integer 6
2.1)if it belongs to Product Group K01 ,it is categorized as Category 1
3)If Code starts with integer 2
3.1)if it belongs to Product Group K05 ,it is categorized as Category 2
Input:
Product Group | Code |
K01 | YS4341 |
K05 | YS4342 |
K01 | YT0517 |
K05 | YT0518 |
K01 | 642130 |
K05 | 642130 |
K01 | 690802 |
K05 | 690802 |
K01 | 290802 |
K05 | 290802 |
Output:
Product Group | Code | Category |
K01 | YS4341 | Category1 |
K05 | YS4342 | Category2 |
K01 | YT0517 | Category1 |
K05 | YT0518 | Category2 |
K01 | 642130 | Category1 |
K05 | 642130 | |
K01 | 690802 | Category1 |
K05 | 690802 | |
K01 | 290802 | |
K05 | 290802 | Category2 |
Hi there
Maybe try this:
if(
left(Code,1)/1>0,
if((left(Code,1)=6) AND [Product Group] = 'K01' ,'Category 1',
if((left(Code,1)=2) AND [Product Group] = 'K05' ,'Category 2',))
,if([Product Group] = 'K01','Category 1',if([Product Group] = 'K05','Category 2')))
Regards,
Mauritz
Hi there
Maybe try this:
if(
left(Code,1)/1>0,
if((left(Code,1)=6) AND [Product Group] = 'K01' ,'Category 1',
if((left(Code,1)=2) AND [Product Group] = 'K05' ,'Category 2',))
,if([Product Group] = 'K01','Category 1',if([Product Group] = 'K05','Category 2')))
Regards,
Mauritz