April 22, 2019
Hi all,
I would be gratefuk to everyone who will help me solve two problems
1)
I tried to manage flow over time with PQ but something does not work....sob 😉
Attached you will find two files....containing source and data
2) (and more difficult without VBA)
Automate all the steps (copy first,download second and finally stratification )
Sure I will find here a good solution
thanks in advance
Stefano
Power Query
Power Pivot
Xtreme Pivot Tables
Excel for Decision Making
Excel for Finance
Excel Analysis Toolpak
Power BI
Excel
Word
Outlook
Excel Expert
Excel Customer Service
PowerPoint
November 8, 2013
Power Query
Power Pivot
Xtreme Pivot Tables
Excel for Decision Making
Excel for Finance
Excel Analysis Toolpak
Power BI
Excel
Word
Outlook
Excel Expert
Excel Customer Service
PowerPoint
November 8, 2013
Hi Stefano,
In Nuove query you have this:
= Table.NestedJoin(#"Giacenti Precedenti", {"Code"}, Giacenti, {"Code"}, "Giacenti", JoinKind.RightAnti)
The 2 queries used in this Join are exactly the same, therefore will return an empty table because Right Anti means "return all rows that can be found only in second table"
Nuove P is exactly the same query as #"Giacenti Precedenti" and Giacenti query, so it works the same, no idea why you are using the same query 3 times. All work the same and return the same data.
In STRAT Nuove, there is another strange thing:
let
Origine = Table.Combine({#"Nuove P", #"Nuove P"}),
#"Rimossi duplicati" = Table.Distinct(Origine, {"Date"})
in
#"Rimossi duplicati"
Basically, you intentionally duplicate the data by combining the same query twice, then you remove duplicates. Still works, but it's a nonsense from my point of view.
Make sure the First.xlsx workbook is closed when you refresh the queries, otherwise your code should be modified to handle open workbooks.
April 22, 2019
Hi Catalin,
I would like to manage records that come out (definito), that come in (nuove) and that stay in a table (giacenti).
To do this over time I have to rely on a second table where to copy the data before they change and then update it.
Whenever the data changes, it may be that someone leaves, someone enters and someone remains ... hence the idea of the Definito queries (for those that come out) and the Nuove query (for those that enter) ....the two query Definito Precedente e Nuove P have the function of supporting to compare the data in two different periods.
Do you have a method to suggest me with POWER QUERY to manage these situations???
Thanks
Power Query
Power Pivot
Xtreme Pivot Tables
Excel for Decision Making
Excel for Finance
Excel Analysis Toolpak
Power BI
Excel
Word
Outlook
Excel Expert
Excel Customer Service
PowerPoint
November 8, 2013
April 22, 2019
Catalin Bombea said
I don't understand your process to be able to help.Your first table is just a list of names, codes and dates.
How do you define records that come out? They just "dissapear" from the list in the next day?
No.there are three different situations:they "dissapear" (definito), they enters for the first time ( nuove ) and they are different than definito and the last situation, records that not disappear and not news...stuck tecords....now in a little bit more clear....
Power Query
Power Pivot
Xtreme Pivot Tables
Excel for Decision Making
Excel for Finance
Excel Analysis Toolpak
Power BI
Excel
Word
Outlook
Excel Expert
Excel Customer Service
PowerPoint
November 8, 2013
Power Query
Power Pivot
Xtreme Pivot Tables
Excel for Decision Making
Excel for Finance
Excel Analysis Toolpak
Power BI
Excel
Word
Outlook
Excel Expert
Excel Customer Service
PowerPoint
November 8, 2013
Power Query
Power Pivot
Xtreme Pivot Tables
Excel for Decision Making
Excel for Finance
Excel Analysis Toolpak
Power BI
Excel
Word
Outlook
Excel Expert
Excel Customer Service
PowerPoint
November 8, 2013
Power Query
Power Pivot
Xtreme Pivot Tables
Excel for Decision Making
Excel for Finance
Excel Analysis Toolpak
Power BI
Excel
Word
Outlook
Excel Expert
Excel Customer Service
PowerPoint
November 8, 2013
Sorry to disappoint you, what you want looks more like a customer count over time normally used for e-commerce, see image attached. This is handled by Power Pivot, not Power Query, PQ will just bring the data, the rest of time intelligence calculations are handled much better in PP.
Instead of using the same First.xlsx file every day, you can use a template and save it everyday with the date as file name, you can easily combine them in Power Query.
It is possible to keep existing data while getting new data, but it's just a workaround and not a solid solution.
Power Query
Power Pivot
Xtreme Pivot Tables
Excel for Decision Making
Excel for Finance
Excel Analysis Toolpak
Power BI
Excel
Word
Outlook
Excel Expert
Excel Customer Service
PowerPoint
November 8, 2013
April 22, 2019
Thanks Catalin,
but your solution is not what I need.
I have to be able to compare two lists "n" times ( t1,t2,t3....tn) and count the records that come and go in the two periods and then stratify over time.
Example in the attached files (three excel files)
T1= 8 item "giacenti"
T2= 16 item "giacenti" of wich 8 items news )
T3 =23 item "giacenti" of wich 9 item news + 2 item defined (definito)
Stratification
- Stratification new = 17 item
- Stratification definito= 2 item
and so on for t4 t5, tn......
Ciao
Stefano
Power Query
Power Pivot
Xtreme Pivot Tables
Excel for Decision Making
Excel for Finance
Excel Analysis Toolpak
Power BI
Excel
Word
Outlook
Excel Expert
Excel Customer Service
PowerPoint
November 8, 2013
The last 3 files brings even more confusion.
Initially, you had:
Date | Code | Name |
4/02/2020 | 35 | Lara |
5/02/2020 | 36 | John |
6/02/2020 | 37 | Steve |
7/02/2020 | 38 | Lara |
8/02/2020 | 39 | John |
9/02/2020 | 40 | Steve |
Now, you have:
1/01/2020 | John |
2/01/2020 | Paul |
3/01/2020 | Charles |
4/01/2020 | Mia |
5/01/2020 | Sia |
6/01/2020 | qui |
7/01/2020 | quo |
8/01/2020 | qua |
What defines the uniqueness of a record? The name or the Code? I thought it's the code, based on your initial data.
Anyway, see attached way to solve some of the questions with power query and Power pivot, hope this point you in the right direction.
If your way of doing things is based on importing data from a folder, then you should change the data query, now it takes data from the same file as described in previous message.
If your unique records are identified by name not by code, you have to change the measures accordingly.
1 Guest(s)