Using wildcard in LOOKUPVALUE

labrecquev

New Member
Joined
Feb 22, 2016
Messages
1
Hi guys, first post here,

I've been working on a problem for a couple of days in PowerPivot.

I want a new column to lookup for a match between some text contained in a string and a lookup table, and to return column 2 of the lookup table.

Acutal table
Lookup columnCalculated column
Ok w.m whiteWhite Marble
whitemarble BWhite Marble

<tbody>
</tbody>






Lookup table
ValueReturn
w.mWhite Marble
whitemarbleWhite Marble

<tbody>
</tbody>

I've tried using wildcards in the LOOKUPVALUE different ways:
=LOOKUPVALUE(lookuptable[Return], "*lookuptable[Value]*", actualtable[LookupColumn])

I've also tried "*", or only *, without result...

I was able to make it work in excel with INDEX(MATCH), but not in PowerPivot.
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
This can be done in Power Query, as you can see in the attached file: https://www.dropbox.com/s/qb3ornzaoqydn4r/ME_UsingWildcardLookupvalue.xlsx?dl=0

I was looking for this solution for quite some time. I was able to replicate it to my data and it works like a charm! Thank you very much!
BUT..... My Data set is a lot bigger than the example shown: Data table around 80.000 lines and Lookup table with over 125.000 lines. The solution works still in principle, but it takes awefull long to refresh the data - to the point that its better to get back to Excel VLOOKUP wildcard search :(
Any suggestion for an optimization with PQ?
 
Last edited:
Upvote 0
Try adding a Table.Buffer.

let
Source = Excel.CurrentWorkbook(){[Name="LookupTable"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Value", type text}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each Table.Buffer(ActualTable)),
#"Expanded Custom" = Table.ExpandTableColumn(#"Added Custom", "Custom", {"Lookup column", "Calculated column"}, {"Lookup column", "Calculated column"}),
#"Added Custom1" = Table.AddColumn(#"Expanded Custom", "Custom", each if Text.Contains([Lookup column],[Value])=true then [Calculated column] else ""),
#"Removed Columns" = Table.RemoveColumns(#"Added Custom1",{"Lookup column", "Calculated column"}),
#"Filtered Rows" = Table.SelectRows(#"Removed Columns", each ([Custom] <> ""))
in
#"Filtered Rows"

You might buffer other items as well if this doesn't help enough - just shout out.
 
Upvote 0
Thanks ImkeF for your reply.
Didn't help yet :( It's loading the data with approx 1 row per sec :eek:
More ideas?
 
Upvote 0
This will depend on the structure of your lookup-values: Are they one-word (no spaces) or do they contain combinations with spaces in between?
 
Upvote 0

Forum statistics

Threads
1,215,064
Messages
6,122,941
Members
449,094
Latest member
teemeren

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top