Forum Discussion
using calculate function
Hi JarroVGIT
Thank you for your response.
I can imagine that the logic is a bit complex. However, to answer your questions
Q1: Why is Apple in 2020 7-1=6?
Apple in 2020 is 7 -1 = 6 because from the inventory (table 2), the total amount of apples are 7 and in 2020 and apple is rented out from 01-01-20 till 01-01-21 (table 1, row 1). The means that the apple with ID 1234 would be reduced by 1 from 01-01-20 i.e "from date" , till the01-01-21 i.e "end date" when it becomes available again.
Remark: Sold = Rented (when item is rented, 1 is subtracted(-1) from the total qty in the inventory(table 2)
Available (when item is rented, 1 is added (+1) from the total qty in the inventory(table 2)
Q2: ID in Table 1 is the same ID in table 2?
Yes, the ID's are the same. The ID are unique identifiers for the items. the relationship is a many to one relationship.
The whole idea is to create a measure to know the qty of items in the inventory that are available to be rented out everytime(in this case yearly).
Lets me know if it is clear now JarroVGIT
Best Regards,
Charlie101
My tip for you is: reconsider your datamodel and logic you want to apply, as this will become messy quickly.
- Anonymous6 years agoNot applicable
Thanks for the tip JarroVGIT !
The from date and the end date in table 1 would be linked to a date table. With the date table, the date can be shown as Day, Months or Year.
Available implies that the item has been returned and is available to be rented out for the period between the start date till the end date