Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

PowerQuery: Force Lowercase for an alphanumeric Text

How are you able to force an alphanumeric string to lowercase (or uppercase) in powerQuery?

I have a series of attribute codes coming into powerQuery , but the codes contain variations of
upper case and lower case text. In practice these items would be considered duplicates, but PowerQuery is case sensitive. I’ve tried using Text.lower / Text.upper but this requires the data to be type text. My data is alphanumeric (123abc, 111, aaa) and text functions do not work for data type any

Suggestions?
description below:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

' Activity       Activity ID'

  Apple          1CA11
  Apple          1ca11
  Orange         2dp23
  Orange         2DP23

'This should become: 
  Apple          1ca11
  Orange         2dp23

Picture below:
Error Example using Text.lower

Removing Duplicates

>Solution :

You could ignore case of just the Activity ID field in Table.Distinct operations

= Table.Distinct(Source,{{"Activity", Comparer.Ordinal}, {"Activity ID", Comparer.OrdinalIgnoreCase}} )

or ignore case in all columns in the Table.Distinct

= Table.Distinct(Source, Comparer.OrdinalIgnoreCase)
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading