Forum Discussion
IMett
5 years agoHelper III
Direct Query optimization with date table
Hi everyone, I have a simplified model with a calender table [BLAllgemein Datum] and a Fact Table [BL_Vertrag FAKT ...] looking like this. The fact table has - 1 summable column "AnzahlLaufend...
IMett
5 years agoHelper III
Hi amitchandak , thank you for your suggestion.
Unfortunately this wasn't a solution yet.
All of the queries still translate to the same long T-SQL query. While the userelationship version is somewhat faster than the other 2, it does not output the same results, in fact the result table is empty.
The problem is probably, that the relationship filters [Datum] = [StatistischGueltigBisDatum] for every [Datum] in 2021. However, most of the StatistischGueltigBisDatum values are far after 2021, so that no matches are found.
What I actually need is the condition FactTable[StatistischGueltigAbDatum] <= Calender[Date] < [FactTable[StatistischGueltigBisDatum]