Skip to content

Pivoting

  • Status: accepted
  • Deciders: Equip de Dades
  • Date: 2022-10-06

Technical Story:

Context and Problem Statement

Per fer els indicadors derivats ens convé tenir dades amples on cada columna és l'indicador i la primera fila create date

Decision Drivers

  • [driver 1, e.g., a force, facing concern, …]
  • [driver 2, e.g., a force, facing concern, …]

Considered Options

  1. dbt pivot (modified)
  2. crosstab de postgres
  3. pandas (via fal)

Decision Outcome

Hem triat 1. dbt pivot perquè resol el tema en pur sql i views.

Positive Consequences

  • [e.g., improvement of quality attribute satisfaction, follow-up decisions required, …]

Negative Consequences

  • [e.g., compromising quality attribute, follow-up decisions required, …]

Pros and Cons of the Options

dbt pivot

[example | description | pointer to more information | …]

  • Good, because [argument a]
  • Good, because [argument b]
  • Bad, because [argument c]

crosstab

[example | description | pointer to more information | …]

  • Good, because [argument a]
  • Good, because [argument b]
  • Bad, because [argument c]

pandas fal

  • Good, because very flexible
  • Bad, because
  • [Link type] [Link to ADR]