Forum Discussion
Need help to resolve Excel Formula using Let,Take,index,Sort,Unique,HSTACK,MMULT,TOROW,MONTH.
- Sep 07, 2023
Thank you. Do I understand correctly that csv62719 is you source file. If to avoid Power Query we copy/paste data from it into the sheet in main file, here by formula create massaged range and based on it and month/year/monthid parameters create aggregated result. Workflow is correct?
Sorry for the misunderstanding, in a previous image you had it right.
In a previous capture you got it just right the C and D where the same so it added the amount.
Norman_McIlwaine Sergei, If I change the date(day) to a 1 The function works great, Is there anyway we can add in a piece of code to perform a unique when the function is finished I have tried several ways to include this into the function but have failed every time. I even wrote a separate piece of code which I got from the You Tube and adapted it to test my data prior to inserting however I get the same results frustration.
Can you please help me Sergei?
- Norman_McIlwaineNov 29, 2023Brass ContributorI did the repair and installed the latest Microsoft 365 from online and continue to get the same errors when inserting a PIVOT Table.
So far, I have narrowed down the MSOLAP$LocalCube error to when I select a Table in Excel and use the Insert -Pivot Table command four errors appear immediately in the Event Viewer Log. However, if I continue and create a pivot table then delete the pivot table and I recreate using same commands against the same Excel Table Insert Pivot Table I do not get an error message. If I change my Excel Table to another Table and perform insert Pivot command the error appears.
Is this a bug with EXCEL or PIVOT Table?
Your expertise would be appreciated. - Norman_McIlwaineNov 28, 2023Brass Contributor
Tried to add data to data and I get the MSOLAP error message. I will now do a repair of Microsoft 365 and see if that will clear the error message.
- SergeiBaklanNov 28, 2023MVP
That's quite old thread Event ID 25 from source MSOLAP$LocalCube (microsoft.com) if something could help from it.
I'd check first if Power Pivot (data model) works on any new file - create simple source table, build PivotTable adding data to data model. If doesn't work perhaps you need to repair the Office.
- Norman_McIlwaineNov 28, 2023Brass Contributor
- SergeiBaklanNov 27, 2023MVP
Is that on Windows?
- Norman_McIlwaineNov 27, 2023Brass Contributor
Ok. Thanks for the speedy response. I have been updating my skills and using Power query with Pivot Tables. I am not sure if this is an excel question or a Microsoft question. Every time I open a pivot table for an Excel table, I get four error messages in my event log:
I have tried installing the MSOLAO like it says and still get the same error message. Have you seen a fix for this anywhere?
- SergeiBaklanNov 27, 2023MVP
I'm not familiar with iPad. If Power Query that's only to refresh. Otherwise to build dynamic array formula from scratch.
- Norman_McIlwaineNov 27, 2023Brass Contributor
I have a small problem with not having the capabilities to refresh the data on a IPAD, it is imposable to change the month and get accurate results in the Excel output. I have tried to work around this and still run into the same problem, I have also requested this as an enhancement to Excel. However, it is not high on their priority list, and I can't get enough votes to get the fix to move it up on the list.
Is there any other way to get the results without having to do a refresh every time.?
- Norman_McIlwaineNov 27, 2023Brass Contributor
HI
I have a small problem with not having the capabilities to refresh the data on a IPAD, it is imposable to change the month and get accurate results in the Excel output. I have tried to work around this and still run into the same problem, I have also requested this as an enhancement to Excel. However, it is not high on their priority list, and I can't get enough votes to get the fix to move it up on the list.
Is there any other way to get the results without having to do a refresh every time.?
- Norman_McIlwaineOct 08, 2023Brass ContributorThank you for the quick and excellent response.
- SergeiBaklanOct 08, 2023MVP
With Power Query it's better to calculate it separately (Opening Balance query in attached file), result will be like
and Closing Balance is calculated as
=SUBTOTAL(109,[Amount]) + Opening_Balance[Opening Balance]
- Norman_McIlwaineOct 07, 2023Brass Contributor
I am trying to set current month's ending balance to be next month's opening balance. I have tried various different date functions (i.e.PreviousMonth) but cannot get this to work. Is this possible in PQ?
(previous months balance)
Opening Balance 2,349.73 (Current month)
Balance 3,594.20
- SergeiBaklanSep 27, 2023MVP
Norman_McIlwaine , okay, thank you for the feedback.
- Norman_McIlwaineSep 27, 2023Brass ContributorThanks problem solved.
- SergeiBaklanSep 27, 2023MVP
Replacement table is in the first sheet of the file, in grid.
Modify it here and Refresh All. Power Query only reads that table.
- Norman_McIlwaineSep 27, 2023Brass Contributor
- Norman_McIlwaineSep 27, 2023Brass ContributorI have been away for a while and I am just getting back into PQ again. I was trying to add a new entry in the table replacements and I find that I can not do this using PQ editor. I believe this is because when I open the table it is in preview mode. All that I can do is to view the data in the table. How can I edit the table to insert a new row ?
- Norman_McIlwaineSep 12, 2023Brass ContributorThanks for helping me out on this one. I was entering excel functions instead of M code functions. I must get a book on M code.
Thanks again. - SergeiBaklanSep 12, 2023MVP
I added
fnPayment = (str as text) => Text.Trim( Text.Combine( List.Skip( Splitter.SplitTextByCharacterTransition({"0".."9"}, {" "} )(str), (q) => Text.StartsWith(q, "PAYMENT -") and Text.Length(q) = 14 ) ) ),
into the body of query and replace texts with help of it.
- Norman_McIlwaineSep 12, 2023Brass Contributor
Thank you very much for the enhancements it looks fabulous. I have one problem which I have been working on all day.
Its how do I do a removal on a transaction without the use of the * or ? in a find and replace situation.
In Excel I could do a find and replace with find PAYMENT???????? replace with XXXXXXXXXXXXX.
Unfortunately without the use of * or ? in PQ it is difficult and I have tried some work arounds but all failed with errors.
I would like to change the transaction PAYMENT - XXXX with nothing leaving the remainder of the text in the field where this text appears in the transaction field.
Example
If transaction = PAYMENT - 1155 NEO FINANCIAL replace with NEO FINANCIAL.
The numeric value changes on every occurrence therefor, I tried to remove the first 15 characters PQ and got into a lot of errors. What would be your work around this statement?
If you could help me out I would appreciate it very much.
- SergeiBaklanSep 11, 2023MVP
I added the table in first sheet for the replacements
In second sheet is the list of accounts with added empty record
it is used for drop-down list in the reporting. Didn't transfer 4.51e+15 into long number and keep it as it is. Since in csv files it could be shown as 4.51e+15, 4.5140e+15, whatever. It looks like you open csv in Excel and save it on closing, thus account is saved as Excel transforms it.
Not critical, but to be safe better not to open csv in Excel such way. Better to allow legal connector in options
With that in new Excel file you may insert csv as Data->Get data->Legacy Wizard->From text and on third step set data type as Text for Account column
Above is assuming if 45000... was not converted on 4e+15 before.
Finally in Reports sheet added one returned by Power Query
you only need to refresh it if parameters were changed.
- Norman_McIlwaineSep 09, 2023Brass ContributorSorry Sergei, Of course the report is after you pass the transaction from PQ to excel run it through the Excel formula. I was not thinking as I am in the middle of moving houses as well as this project.
- Norman_McIlwaineSep 09, 2023Brass Contributor
It is looking very good and I am able to follow the M source for Transaction changes on the csv file. However i cannot see how the report is structured in the source code. If for instance, rather than type in and remember a16 digit account numbers I could have a pick box attached to the id field of the four account numbers. similar to the pick box I added to the Excel output.
The Total Income and Total expenses (which was a great after thought thank you) was a nice surprise in the report.
PETRO CANADA AND Esso are Gasoline and should be summed together if possible?
The Source in PQ is showing Petro Canada as 29.47 and the report shows 49.05 with only one Petro Canada entry in the Transaction field for the month = 8 could I be missing something in the source file for the month = 8.
If I could see the source for the report I perhaps could help.
Thanking you for any assistance.
- Norman_McIlwaineSep 09, 2023Brass ContributorThanks for the quick response, I will give a try.
- SergeiBaklanSep 09, 2023MVP
Tried to correct, please check in attached if I understood the logic correctly.
Query is within the file. On ribbon Data->Queries and Connections. Double click on right pane on query name to open it in Power Query Editor. Within it you may use Home->Advanced Editor to play with generated M-code.