Forum Discussion
Replace Values in a Column bases on 2 other Columns
- 6 years ago
Hi Anonymous,
The formula given works (had to change [Application ID] in the forumla to [ApplicationId] as it appeared in the Excel file), and had to convert the date to Text per your original requirements, but I am wondering if the issue is the July 11 piece vs the year. One of your examples has 7/11/2019, and another 7/11/2020. So I changed it to handle any July 11 in the 21st century.
if Text.StartsWith([Period], "7/11/20") and [ApplicationId] >= 34 and [ApplicationId] <= 36 then "Baseline" else [Period])Then I added some fake 7/11/2020 data to your Excel table and I get this:
Works for 2019 and 2020.
Here is the file back with that working. If you truly only want July 11, 2019, then use:
if [Period] = "7/11/2019" and [ApplicationId] >= 34 and [ApplicationId] <= 36 then "Baseline" else [Period]and none of the 2020 dates will return the "Baseline" text.
Does that help?
Hi Anonymous,
The formula given works (had to change [Application ID] in the forumla to [ApplicationId] as it appeared in the Excel file), and had to convert the date to Text per your original requirements, but I am wondering if the issue is the July 11 piece vs the year. One of your examples has 7/11/2019, and another 7/11/2020. So I changed it to handle any July 11 in the 21st century.
if Text.StartsWith([Period], "7/11/20") and [ApplicationId] >= 34 and [ApplicationId] <= 36 then "Baseline" else [Period])
Then I added some fake 7/11/2020 data to your Excel table and I get this:
Works for 2019 and 2020.
Here is the file back with that working. If you truly only want July 11, 2019, then use:
if [Period] = "7/11/2019" and [ApplicationId] >= 34 and [ApplicationId] <= 36 then "Baseline" else [Period]
and none of the 2020 dates will return the "Baseline" text.
Does that help?
Edhans-----thanks, you have been a great help!
- edhans6 years ago
Community Champion
Glad to help Anonymous !