Hello. I have a question, which I think is simple for the veterans of the forum. I do not have much SQL notion, but I need to integrate two files into excel One stock and one sales
There are two different xls. Both have a BD (tab) called "General Base."
I have columns for branding, product, month, year, and values ... where:
In the stock worksheet, my value field is called STOCK and in sales, SALES
I need to create a third spreadsheet that consolidates the two via Query, where I will take the (MARK / PRODUCT / YEAR / MONTH) columns of the two and I will take STOCK and SALES as well as create a third column .. In this third column, called "OUTPUT STOCK", the formula is as follows:
SAIDA ESTOQUE = Estoque do mês anterior* + venda - estoque do mês atual
In this way, in the previous month's inventory, you would need to do a prov or somase, pulling the value from the previous month ... for example. if I bring a line that has February, it should bring (STOCK JANUARY + February sales - February Stock)
If someone helps me solve it, I thank you immensely. PS: I already used union in sql, but I packed the columns with different names
[! [image 1 - stock base] [1]] [1]
[! [image 2 - sales base] [2]] [2]
Unfortunately, I can not insert all images