添加YearWeek列的好处是什么,当年份和周数分别存在于不同的列中时?

huangapple go评论82阅读模式
英文:

What is the benefit of adding YearWeek when year and week exist as separate columns?

问题

Yearweek是年份和周数的组合。当年份和周数已知时,拥有YearWeek列的好处是什么?

英文:

I'm looking at data model and there is column for date, year, week, yearweek.

Yearweek is concatenation of year and week.

What is the benefit of having the YearWeek column when year and week are available?

答案1

得分: 2

它可以用于各种事情。我在我的桌子上有一个用于排序的。例如,如果您想在表格或图表中显示"第3周,2023年"作为标签,您可以使用您的列作为排序列。

它可以用来简化每周时间智能,例如创建一个筛选器,可以轻松跨越年度边界等。

英文:

It can be used for various things. I have one in my table for sorting purposes. e.g. if you wanted to display "Week 3, 2023" in a table or chart as a label, you'd use your column as a sort by column.

It called about be used to simplify weekly time intelligence e.g. create a filter this many weeks in the past which easily crosses year boundaries etc

答案2

得分: 1

我认为这也与性能有关。如果你在数据库中添加了该列,那么在创建表格时会降低性能,而在周年度准备好后,在报表填充方面会提高性能。不需要在报表端应用任何串联。而且反之亦然。

现在这是我们的决定,我们需要更好的性能。

英文:

I think it's related to performance as well. If you are adding the column in the database, you are losing performance while creating a table and gaining performance on the report population as the week-year is ready. No need to apply any concatenation on the reporting side. And this is true for the opposite way.

Now it's our decision, where we need better performance.

huangapple
  • 本文由 发表于 2023年3月3日 20:03:21
  • 转载请务必保留本文链接:https://go.coder-hub.com/75626828.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定