Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Team,
can we use case statement in script or Expression?
I have the two Sales Level 1 and Sales Level 2.
In Sales Level 1 I have Field EMEAR-REGION which is mapped to Sales Level 2 value i.e
EMEAR - CENTRAL
EMEAR - SOUTH
EMEAR - EMERGING
EMEAR - NORTH
EMEAR - UK
But in above Field If I select EMAR-REGION then it should directly associate to EMEAR - EMERGING
and I want to create one more Field with name EUROPE in Sales Level 2 which should directly pick the remaining 4 fields.
Regards,
KK !
you cannot use or he has given two conditions yu can use mapping or you can use if condition
Not quite clear with your requirement. As per what I understood, you can use Mapping Load/ApplyMap or nested if conditions. Though Maaping Load/ApplyMap is the recommended way.
/* Mapping Load */
DECODE:
Mapping LOAD * INLINE [
SLS_LVL_2, SLS_LVL1
EMEAR-EMERGING, EMEAR-REGION,
EMEAR-CENTRAL, EUROPE
EMEAR-SOUTH, EUROPE
EMEAR-NORTH, EUROPE
EMEAR-UKI, EUROPE
];
LOAD
ApplyMap('DECODE',[Sales Level 2],[Sales Level 1]) as [Sales Level 1],
[Sales Level 2],
[Net Bookings]
FROM
File.xlsx
(ooxml, embedded labels, table is Sheet1);
(OR)
/*If Condition */
LOAD
If([Sales Level 2]='EMEAR-EMERGING','EMEAR-REGION',
If(Match([Sales Level 2],'EMEAR-CENTRAL','EMEAR-SOUTH','EMEAR-NORTH','EMEAR-UKI'),'EUROPE',[Sales Level 1])) as [Sales Level 1],
[Sales Level 2],
[Net Bookings]
FROM
File.xlsx
(ooxml, embedded labels, table is Sheet1);
Regards,
KKR
HI Kranti,
But while using (OR) condtion i am unable to load the script
you cannot use or he has given two conditions yu can use mapping or you can use if condition
Tnx.
Hi Gowatham,
Now I got the data.Suppose if I want a specific condition like
LOAD
If(Match([Sales Level 2],'EMEAR-CENTRAL','EMEAR-SOUTH','EMEAR-NORTH','EMEAR-UKI'),'EUROPE',[Sales Level 1])) as [Sales Level 1],
[Sales Level 2],
[Net Bookings]
this is working for IOT and when I select the IOE categgory then it should combine the data like below.
If(Match([Sales Level 2],'EMEAR-CENTRAL','EMEAR-SOUTH','EMEAR-NORTH','EMEAR-UKI','EMEAR -UNALLOCATTED',EMAE -OTHER),'EUROPE',[Sales Level 1])) as [Sales Level 1],
[Sales Level 2],
[Net Bookings]
I want this specific condtion
Use Noconcatenate before new script code, you might have dropped table at the end. Just guessing.
use mapping load you ll get two different fields
Mapping1:
Mapping LOAD
If(Match([Sales Level 2],'EMEAR-CENTRAL','EMEAR-SOUTH','EMEAR-NORTH','EMEAR-UKI'),'EUROPE',[Sales Level 1])) as [Sales Level 1],
[Sales Level 2]
Mapping 2:
Mapping Load
If(Match([Sales Level 2],'EMEAR-CENTRAL','EMEAR-SOUTH','EMEAR-NORTH','EMEAR-UKI','EMEAR -UNALLOCATTED',EMAE -OTHER),'EUROPE',[Sales Level 1])) as [Sales Level 1],
[Sales Level 2]
first mapping you can use it for IOT and Second for IOE
Can I apply this in one single slot in my given script
Cisco:
LOAD [End Customer Global Ultimate Name],
Country,
[End Customer HQ Top],
[Sales Level 3],
[Sales Level 4],
[Sales Level 5],
[Partner Name],
[Fiscal Period ID] as Fiscalid,
[Net Bookings],
CATEGORY ,
If([Sales Level 2]='EMEAR-EMERGING','EMEAR-REGION',
If(Match([Sales Level 2],'EMEAR-CENTRAL','EMEAR-SOUTH','EMEAR-NORTH','EMEAR-UKI') AND MATCH([Sales Level 2],'EMEAR-CENTRAL','EMEAR-SOUTH','EMEAR-NORTH','EMEAR-UKI','EMEA OTHER'),'EUROPE',[Sales Level 1])) as [Sales Level 1],
[Sales Level 2]
FROM
but its not working
Check this one.