Forum

Power Query, Replac...
 
Notifications
Clear all

Power Query, Replace Text not working for specific text

5 Posts
3 Users
0 Reactions
109 Views
(@s-chambers)
Posts: 6
Active Member
Topic starter
 

Hi,

My file takes a horrendous report from our accounting system and converts it to a table taking away all useless info.

I have added a conditional column to categorise the accounts, based upon their intial number.

However I do have exception to the rule, one specific account (51626) would be categorised as Payroll in the above step when in fact it is an expense.

When I enter this at the end of the add conditional column step , nothing happens, it is still classed as a payroll account.

So I then tried my plan b to merge the 2 columns (category and acct) to give me the combined text and then asked for a replace text to replace the word Payroll with Expenses on that one combination, I then split the column back again.

again it has not worked.
Could you please advise where I am going wrong?

thanks ever so much
Sharon

 
Posted : 07/06/2023 7:43 am
Alan Sidman
(@alansidman)
Posts: 220
Member Moderator
 

Can you supply a dummy file that is representative of your issue so that we can work with your data types.

 
Posted : 07/06/2023 7:37 pm
(@s-chambers)
Posts: 6
Active Member
Topic starter
 

here you go, apologies I thought I had attached.

 
Posted : 08/06/2023 3:00 am
Riny van Eekelen
(@riny)
Posts: 1185
Member Moderator
 

Move the 'else if' where you check for 51626 above the one where you have 'else if..... begins with 5'. Then it will work.

 
Posted : 08/06/2023 5:46 am
(@s-chambers)
Posts: 6
Active Member
Topic starter
 

This is wonderful, thanks so much

Smile

 
Posted : 10/06/2023 4:48 am
Share: