Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm trying to create a new fileds using and in if statement. But i'm not getting any result.
But a simple if statement is not working. I know there should be something wrong in my syntax.
Can someone please help?
Table1:
LOAD * Inline
[
ID, Name
1,A
1,B
1,C
1,D
1,E
];
Table2:
LOAD *,
If(Name='A' and Name='B' and Name='D' and Name='D' and Name='E' , 'special') as test
Resident Table1;
DROP Table Table1;
May be this?
If(Name='A' or Name='B' or Name='D' or Name='D' or Name='E' , '5', Name) as test
Name cannot be A and B and D ...
it could be A or B fr example
No Anil.
ID can have multiple names.
Depending on what names the ID has i havre to create a category field.
Above is one of the example.
ID can have multiple names.
Depending on what names the ID has i havre to create a category field.
Above is one of the example.
Then, you must explain real data which demonstrates the issue
??? could you elaborate it a bit more please?
Try this may be?
If(Match(Name, 'A','B','C','D','E'), 'Special') as test
Hi Mark
/option 1
Table1:
LOAD *, if(WildMatch(Name,'A','B','D','E'),'SPE','OTHER') AS newFieldTest;
LOAD * Inline
[
ID, Name
1,A
1,B
1,C
1,D
1,E
];
//option 2
CHRS:MAPPING LOAD * INLINE [
Name, Test
A, SPE
B, SPE
C, OTHER
D, SPE
];
Table1:
LOAD *, ApplyMap('CHRS',Name,'OTHER') AS newFieldTest;
LOAD * Inline
[
ID, Name
1,A
1,B
1,C
1,D
1,E
];
Mark, i dont know if i right understant, but Id could have multiple values, but only one per line.
Name could be A or B or C or D or E, but not all at the same time.
So change your AND to OR.