cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
HeliosOne Frequent Visitor
Frequent Visitor

Can I save inside content after Python RegEx

Hello!

 

I`m connecting to folder which contains multiply different .xlsx files. Every filename somewhere contains 20 digit account number. At first I need extract account number, recive some number based data from 'dimension table' and make some filtering. After that I want expand 'content' and start working with data inside those files.

 

That is how my folder looks: 

Input.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

I was unable to get steady result with 'column from examples' so I use small Python code to extract account numbers in my dataset.

# 'dataset' содержит входные данные для этого сценария
regex = r'(\d{20})'
dataset['Номер расчетного счета'] = dataset['Name'].str.extract(regex)

Code works well and returns dataset but in 'Value.Content' instead of previous content I recieve 'System.Byte' value.

Output.jpg

 

 

 

 

 

 

 

 

It is important for me to make some filtering on regex`ed dataset before expanding 'content'. Is it possible to save all content in one query after regex?

 

P.S. There is workaround with doubling and merging queries but I would like to stay in one query. 

 

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Can I save inside content after Python RegEx

Hi @HeliosOne ,

to my knowledge, these "nested" columns will not survive a passage through Python.

So you have to parse out /expand the columns you need later before applying the Python-Script.

 

If you liked my solution, please give it a thumbs up. An if I did answer your question, please mark my post as a solution. Thanks!

Proud to be a Datanaut!

Imke Feldmann

How to integrate M-code into your solution -- Check out more PBI- learning resources here -- Performance Tipps for M-queries




View solution in original post

2 REPLIES 2
Super User
Super User

Re: Can I save inside content after Python RegEx

Hi @HeliosOne ,

to my knowledge, these "nested" columns will not survive a passage through Python.

So you have to parse out /expand the columns you need later before applying the Python-Script.

 

If you liked my solution, please give it a thumbs up. An if I did answer your question, please mark my post as a solution. Thanks!

Proud to be a Datanaut!

Imke Feldmann

How to integrate M-code into your solution -- Check out more PBI- learning resources here -- Performance Tipps for M-queries




View solution in original post

Jimmy801 New Contributor
New Contributor

Re: Can I save inside content after Python RegEx

Hello
I don't know what exactly regex is.
However I'm an excel expert and i can tell you that you can extract data in all dynamically way you need. So stay with M and you are on the safe side
Have a nice time
Jimmy

Helpful resources

Announcements
New Topics Started Badges Coming

New Topics Started Badges Coming

We're releasing new versions of the badge that everyone's talking about. ;) Check your inbox for notifications.

MBAS 2020

Save the new date (and location)!

Our business applications community is growing—so we needed a different venue, resulting in a new date and location. See you there!

Difinity Conference

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)