Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello everyone,
I have two tables namely,
Rent_Entity and Rent_Modification.
Rent Entity has all the information about the tenant/contract. Rent Modification is for any rent increase/decrease happened on the contract level.
Now let's say, if I have to select the rent roll for today, I will get all the latest data for the specific contract. But If someone asks me to provide the rent roll on a specific date in past, I need to have the rent for specific contract at that point of time.
For eg.
rent_entity | ||||
id | Contract_Name | total_rent | einzug | auszug |
10 | 70_M_05.01 | 568.9 | 01-11-1980 |
rent_modification | |||||||
contract_id | old_value | new_value | difference | state | start_date | end_date | Kind |
10 | 518.9 | 568.9 | 50 | approved | 1-Feb-19 | RENT | |
10 | 468.9 | 518.9 | 50 | approved | 1-Feb-19 | RENT | |
10 | 105 | 125 | 20 | draft | 4-Feb-19 | BK |
If I take the rent roll for this contract 70_M_05.01, it will give me the rent 568.9 but If I need the rent roll in jan 2019 or in any past date then the rent should show 468.9 as you can see in the old_value of rent_modification table. I also have to have include certain criteria like state = "approved" and Kind = "RENT".
@Ashish_Mathur @Greg_Deckler @Zubair_Muhammad
Please Help!!!!!
Hi,
Why should the rent for Jan 2019 be 468.9? In that row, i do not see the date of Jan 2019 at all.
Hi @Ashish_Mathur . Since the rent increment was happened on 1st Feb 2019 as you see in the rent_modification table. So if I need the rent roll for Jan it should be the previous rent before the increment which is 468.9 in the old_value column.
Hi @Anonymous
I see something strange in your second table, should not the second row have an end date? Should not the 'start_date' be different between the first row and the second row?
Did I answer your question correctly? Mark my answer as a solution!
Proud to be a Datanaut!
Hi @LivioLanzo , It's correct. Somtimes because of some faulty entries we have this kind of data in the db. We don't have end_date for RENT increase because it's a one time increment. End_Date is for other kind of Rent Increase/Decrease where we do certain amount increment/decrement each month for a period of time. For eg. Rent reduction because of something broke in the apartment then we give tenants a discount on rent for few months.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
106 | |
94 | |
77 | |
65 | |
53 |
User | Count |
---|---|
145 | |
105 | |
104 | |
90 | |
63 |