Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I wanted to split a single column into 2 separate columns in the Script.
Logic:
One column which has field values which contains _H
and another Column which doesn't have _H.
Thanks,
SP
Try this?
IF(Index([End ID], '_H') = 6, [End ID]) AS NewField2,
IF(Index([End ID]', '_H') <> 6, [End ID]) AS NewField1
OR
IF(FindOneOf(Replace([END ID], '_H', '@'), '@') > 0, [END ID]) AS NewField2,
IF(FindOneOf(Replace([END ID], '_H', '@'), '@') = 0, [END ID]) AS NewField1,
Try this?
IF(Index([End ID], '_H') = 6, [End ID]) AS NewField2,
IF(Index([End ID]', '_H') <> 6, [End ID]) AS NewField1
OR
IF(FindOneOf(Replace([END ID], '_H', '@'), '@') > 0, [END ID]) AS NewField2,
IF(FindOneOf(Replace([END ID], '_H', '@'), '@') = 0, [END ID]) AS NewField1,
See if this will help
May be as below:
Load ID,
IF(Index(ID, '_H')>0, ID) AS [NewField-With H],
IF(Index(ID, '_H')=0, ID) AS [NewField2-Without H];
Load * Inline [
ID
B2700
B2800
B2700_H10
B2800_H10.1
];
May be something like this???
Output:
Try this,
if(wildmatch([End ID],'*_H*'),[End ID]) as EndID1,
if(not wildmatch([End ID],'*_H*'),[End ID]) as EndID2
Regards,
Pratik
Hi,
Try this:
Load ID,
IF(Index([End ID], '_H') = 6, Max([End ID])) AS NewField2,
IF(Index([End ID]', '_H') <> 6, Max([End ID])) AS NewField1
From Source
Group By ID
Adding the Max function and group by would ensure that the data is on the same line and therefore won't have multiple lines for each ID