Problem with Text.PositionOf and setting the Occurence value

pjmorris

Well-known Member
Joined
Aug 2, 2012
Messages
2,172
Office Version
  1. 365
Platform
  1. Windows
Hi

I want to use this code to extract the first part of a file path:

Power Query:
Location1=Text.Start(Address,Text.PositionOf(Address, "\", 2))
,

However, when this runs it returns the error:

Code:
Error Message:
We cannot convert a value of type List to type Number.
Details:
    Value=List
    Type=Type

In the online documentation I found references to Occurence.Last, Occurence.First, but nothing that would allow me to set the occurence value I need.

Grateful for advice.

Regards
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Hi, can't you use something like
Power Query:
Text.BeforeDelimiter ( Address, "\", x )
. "x" is the number of "\" at which you cut off. Only needed when it it not the first one. (base 0)
 
Upvote 0

Forum statistics

Threads
1,223,714
Messages
6,174,059
Members
452,542
Latest member
Bricklin

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