Power Pivot
Advanced Excel Formulas
August 23, 2019
I have a query
Using from folder to collate multiple sheets into one file & stripping out unwanted data
I need to strip out everything but the lines I have highlighted.
These change each month, so Nov 2022 becomes Dec 2022 and YTD updates with Dec numbers.
I just want those two lines each month and able to update from past month to current month capturing the new month's number as well as the new YTD number.
YTD starts over in new year
YTD comes over as a text, the Dec 2022 appears to come over as a date
I tried something like and it captures the YTD but not the Dec 2022
if Text.Length(Text.BeforeDelimiter([Date],"0",0)) = 1 then 0 else Text.Length([Date])-Text.Length(Text.Replace([Date]," ",""))+1
October 5, 2010
Hi Lisa,
The 'dates' column is text, you can tell because all the values are aligned to the left of the column. The icon in the column header is also ABC 123 rather than the calendar icon which indicates a column of dates.
To keep just those 2 rows you can sort the column then remove other rows.
If you sort in Ascending Order you can keep the last 2 rows: Home tab -> Keep Rows -> Keep Bottom Rows
Is that all you want to do? I wasn't sure what you meant by and able to update from past month to current month capturing the new month's number as well as the new YTD number.
Regards
Phil
Power Pivot
Advanced Excel Formulas
August 23, 2019
Hi Phil
I have multiple clients that change each month, one month may have 25 clients the next 28 clients
Each month the data changes. i.e. I am about to run it and the Jan 2023 will be replaced with February 2023.
I will need to grab the Feb 2023 line which is the total of the daily data and the new YTD for each clients.
I uploaded a data tab that had a few clients and another tab that has what I need
Clients change each month, some the same, some not
Monthly data changes each month, i.e. Dec updates to Jan, Jan to Feb etc.
YTD changes each month
October 5, 2010
Hi Lisa,
you can do this by:
1. Loading the table and duplicate the query so you have 2 queries.
2. In the first query filter out any rows that do not contain YTD in the date column, this is now Table1.
3. In the other query (Table 2) filter out rows that DO contain YTD. This leaves you with just dates in the date column.
4. Filter the Date column to keep only the earliest dates. This gives you the first of the month for each client. there are 2 rows for each client because you have the individual entry as well as the total for the month.
5. Sort the rows by Client Name (Ascending) and Payment1 (Ascending). For each client the 2nd row is now the end of month value.
6. Add an Index column starting from 1
7. Remove the odd numbered rows, using the Index column values
8. Append the 2 queries
Regards
Phil
1 Guest(s)