Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
Why doesn't this if statement work? Or how can I do this?
Id,company
1,ford
1, vw
2,ford
2,bmw
2,mini
Load
Id,
If(company = 'ford' and company <> 'mini,1) as test
I'd ,test
1,1
2,0
Thanks
Something like:
t1:
Load * Inline [
Id,company
1,ford
1, vw
2,ford
2,bmw
2,mini];
t2:
Load
Id,
If(WildMatch(Concat(DISTINCT company), '*ford*') And
Not WildMatch(Concat(DISTINCT company), '*mini*')
,1,0) as test
Resident t1 Group By Id;
Drop Table t1;
Hi @D19PAL,
Please correct the expression If(company = 'ford' and company <> 'mini',1)
and it will help us to understand if you also share the required output.
This is what I require, I know it won't work, but how can I make it work.
Hi @D19PAL ,
I can help you, but if let me know what exactly you are looking from this expression
Something like:
t1:
Load * Inline [
Id,company
1,ford
1, vw
2,ford
2,bmw
2,mini];
t2:
Load
Id,
If(WildMatch(Concat(DISTINCT company), '*ford*') And
Not WildMatch(Concat(DISTINCT company), '*mini*')
,1,0) as test
Resident t1 Group By Id;
Drop Table t1;
Perfect, there may be more help required lol, watch this space.
How can I do this if I didn't know the name of the company in field company? It works a treat with the fields I know the outcome, but I got another field like company where I don't know the values in the field.
Thanks