If then else statement on weekly granularity

joslaz

Board Regular
Joined
May 24, 2018
Messages
71
Hello everybody!

I have the following two tables:
tblInventory
ArticleValueDate (Today)
AA1500007.12.2019

tblChanges
ArticleValueDate
AA1-50006.10.2019
AA1250005.11.2019

The tblInventory shows the current inventory level.
The tblChanges shows the different positive and negative bookings for each day.

Know I need a measure, that shows me for the current week the actual inventory from tblInventory and for last week the actual inventory (tblInventory) - Value (tblChanges).

How would you do that?
 

g0lub

New Member
Joined
Dec 6, 2019
Messages
7
Office Version
2010
Lets rename first sheet as "inventory" like this:
Noarticlevalue
1A130
2A225
3A315
In row "value" there is formula " =SUMIF(changes!$B$2:$B$2000,B2,changes!$C$2:$C$2000) "

Second sheet named "changes" looks like this:
Noarticlevaluesdate
1A150
2A1-20
3A230
4A315
5A2-5
Here you can make changes for the articles.

I didn't understand what do you want with dates, can you explain again with an example?
 

macfuller

Active Member
Joined
Apr 30, 2014
Messages
251
How many rows does tblInventory have? e.g. a single weekly value or a daily value? My question is which table to go against - if tblInventory has the actual inventory for each day such that the sum of all daily changes in tblChanges is the difference from the previous row's value in tblInventory, then you can do the measure just against tblInventory (i.e. Today's tbleInventory[Value] - DATEADD(tblInventory[Value], -7, DAY)

And do you have a separate date table?

Since you may have Article AA1 multiple times in tblInventory you can't do a 1:many relationship with tblChanges, so RELATED functions probably won't work.
 

g0lub

New Member
Joined
Dec 6, 2019
Messages
7
Office Version
2010
tblInventory has 3 columns. Number, name of the article and current value of that article. Which means you know how much sugar, for example, do you have in market.

Why do you need article AA1 multiple times in tblInventory? If you have different types of sugar, let them be different articles.

I didn't understand what is purpose of date in tables. Do you just need to know when did you buy some articles or something more?
 

Forum statistics

Threads
1,082,360
Messages
5,364,920
Members
400,815
Latest member
Joaquin Phoenix

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top