Forum Discussion
No Syntax Errors but Query Won't Work
- 5 years ago
Anonymous
Update the bit from #"Removed Duplicates" onwards:
#"Removed Duplicates" = Table.Distinct(#"ClearNulls", { "DATE" } ), LastStep_ = Table.SelectRows(#"Removed Duplicates", each [date] >= List.Min(#"Removed Duplicates"[date]) and [date] <= Date.AddYears(List.Min(#"Removed Duplicates"[date]),5)) in LastStep_Please accept the solution when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Anonymous
The error message is quite clear. In your last step you are attempting an AND between two tables. That does not make sense. AND is applied to arguments of type logical. What exactly are you trying to do in that step?
|
|
Please accept the solution when done and consider giving a thumbs up if posts are helpful. Contact me privately for support with any larger-scale BI needs, tutoring, etc. |
- Anonymous5 years agoNot applicable
#Filtered Rows onwards is the code for "de-scattering" my data, which bumps the data up to the top cleaning it up.
On reddit, I was told to do this:
"At any rate, this will go five years from the earliest date in your [date] column.
= Table.SelectRows(#"Added Custom", each [date] >= List.Min(#"Added Custom"[date]) and [date] <= Date.AddYears(List.Min(#"Added Custom"[date]),5))
Replace #"Added Custom" with your previous step and [date] with your date column. Pay close attention to how you are adding this, and if it is not the last step it needs a comma after it. I tested it from 1/1/2020 and the last date to show will be 1/1/2025".
Every part of my code is correct and works, except for this last line. The goal for this line you are saying is incorrect is to return dates within 5 years of the earliest date in the spreadsheet. The earliest date will vary, so I need all the date within 5 years, nothing later. I just can't figure out what is wrong with the code, so if theres another way to write this which would generate the same results that would be great. Thanks