Hi HeinzWaescher,
see the docs about lookup
Note: The lookup command can accept multiple lookup and local fields and destfields. For example:
lookup <lookup-table-name> <lookup-field1> AS <local-field1>, <lookup-field2> AS <local-field2> OUTPUTNEW <lookup-destfield1> AS <local-destfield1>, <lookup-destfield2> AS <local-destfield2>
the only thing you must be aware of, is that the local-field
should exists if you use it in a lookup. That would be in your use case User and Country
.
hope this helps ...
cheers, MuS
Hi MuS,
What should be the query if we need to perform the search on same local-field?
lookup lookup-table-name lookup-field1 AS local-field1, lookup-field2 AS local-field1
OUTPUT lookup-field1, lookup-field2, lookup-field3
Here lookup-field3 is corresponding field in lookup table.
I have tried the above format, but it says no results found!!
Thanks in advance.
Hi HeinzWaescher,
see the docs about lookup
Note: The lookup command can accept multiple lookup and local fields and destfields. For example:
lookup <lookup-table-name> <lookup-field1> AS <local-field1>, <lookup-field2> AS <local-field2> OUTPUTNEW <lookup-destfield1> AS <local-destfield1>, <lookup-destfield2> AS <local-destfield2>
the only thing you must be aware of, is that the local-field
should exists if you use it in a lookup. That would be in your use case User and Country
.
hope this helps ...
cheers, MuS
After some adjustments in my search, it works like expected. Thanks a lot 🙂
let's take this example,
col1,col2,col3,col4
100,300,500,yes
200,400,600,no
Configure this a lookup named mylookup
and you can use the lookup in a search like this:
basesearch | lookup mylookup col1 as field1, col2 as field2, col3 as field3 OUTPUT col4
For each event where all the input values matches, there will be a resulting field, col4, available for that event.
So if you have field1=100 AND field2=300 AND field3=500 then you will get back col4=yes
I wonder if it's possible to do "OR" logic, instead of "AND" logic?
Say, if I have field1=100 OR field2=300 OR field3=500 then I will get back col4=yes
To make an OR you just make multiple lookup with OUTPUTNEW instead of OUTPUT
my search
| lookup mylookup col1 AS field1 OUTPUTNEW col4
| lookup mylookup col2 AS field1 OUTPUTNEW col4
| lookup mylookup col3 AS field1 OUTPUTNEW col4
thank you!
Thank you for this one mate, it helps !
Hi MuS,
I'm not using inputlookup, the table is just called lookup.csv.
The inputfields are existing in the lookuptable and the event. It is an "and" combination of the inputfields, correct? So the lookup should work and add fieldA for an event, when this combination "User/Country" exists in the lookuptable as well.
or are you using inputlookup
because you are providing a lookup.csv
in your example?