0
Hello. I have a question, which I believe is simple for forum veterans. I don’t have much notion of SQL, but I need to integrate two excel files One of stock and one of sales
They are two different xls. The two have a BD (tab) called "General Base".
I have columns of brand, product, month, year and values... where:
In the stock sheet, my value field is called STOCK and sales, SALE
I need to create a third spreadsheet that consolidates the two via Query, where I will take the columns of (BRAND / PRODUCT / YEAR / MONTH) of the two and I will take the STOCK and SALES also, besides creating a third column.. In this third column, called "STOCK EXIT", the formula is as follows::
SAIDA ESTOQUE = Estoque do mês anterior* + venda - estoque do mês atual
This way, in the stock of the previous month, you would need to make a preview or summation, pulling the value of the previous month... for example. if I bring a line that has month of February, should bring (JANUARY STOCK + February sales - February Stock)
If someone helps me solve this, I really appreciate it. PS: I’ve used Union in sql, but I’ve paired columns with different names
[![image 1 - stock base][1][1]
[![image 2 - sales base][2][2]
unfortunately I cannot insert all images
it would be useful to put some code so that we can check only words it is difficult to see your real problem if you have read https://answall.com/help/mcve
– Daniel Gentil
You are importing the
xls
for some table and want to join the data withSQL
? That’s it?– Marcelo de Andrade
actually not Marcelo... I am throwing the two excel files directly to another excel file... in (Data > from other sources >Microsoft Query > excel files).... what I wanted was to unite this query automatically.. this way, every time the two "bases" were updated.. when I updated this query, I was able to replicate what I want to the table
– daniexcel