Forum Discussion
Power Query - Excel - remove data before saving workbook
- 6 years ago
Hello Anonymous
what you could try is something like this
- create boolean parameter- in the last steps of all your queries add a new step with an if-statement. in case the boolean is true hand over your real data, if its's false then only a empty table without any data, but with the correct columns
in this way you would be able to change the parameter and to empty your complete data model
What do think about it?
Jimmy
Hi, Jimmy801 - Thanks for the reply.
I have several queries in the datamodel, and it seems like that is why the query data is being stored in the local file.
In other Excel apps, what I have done is to query one item and save it, but this is not the case for the one I am working on.
I was looking for a way to dump/clean datamodel data so that file is just "virgin";
let me know any thoughts. Thanks!
Hello Anonymous
what you could try is something like this
- create boolean parameter
- in the last steps of all your queries add a new step with an if-statement. in case the boolean is true hand over your real data, if its's false then only a empty table without any data, but with the correct columns
in this way you would be able to change the parameter and to empty your complete data model
What do think about it?
Jimmy
- skythe832 years agoRegular Visitor
My Power Queries have a solution like this enabled. If you don't value the speed of the refresh, you can just put something like this at the end of your query:
= if getValue("rngDummyEnabled") <> "y" then Source else Table.FirstN(Source,0)Full query code:
let Source = CostHistory, #"Kept First Rows" = if getValue("rngDummyEnabled") <> "y" then Source else Table.FirstN(Source,0) in #"Kept First Rows""Source" is the name of the previous query row and "getValue" is a function query (create a blank query and paste code below), which extracts the value of any "named range" field in any sheet:
(rangeName) => Excel.CurrentWorkbook(){[Name=rangeName]}[Content]{0}[Column1]If you do value speed, consider creating a specific dummy query, which outputs all the columns but no rows, whithout processing the actual files.