Skip to content

Commit

Permalink
Revert "Opprett view for Flexjar Sigrun survey"
Browse files Browse the repository at this point in the history
This reverts commit bb65489.
  • Loading branch information
nilsjorgen committed Dec 9, 2024
1 parent bb65489 commit d940eec
Showing 1 changed file with 0 additions and 54 deletions.
54 changes: 0 additions & 54 deletions prod/views-flexjar.tf
Original file line number Diff line number Diff line change
Expand Up @@ -207,57 +207,3 @@ AND team = 'teamsykefravr'
AND (JSON_VALUE(feedback_json, '$.feedbackId') = 'Min oversikt' OR JSON_VALUE(feedback_json, '$.feedbackId') = 'SenFase' OR JSON_VALUE(feedback_json, '$.feedbackId') = 'Historikk')
EOF
}

module "flexjar_virksomheten_din_view" {
source = "../modules/google-bigquery-view"
deletion_protection = false
dataset_id = google_bigquery_dataset.flex_dataset.dataset_id
view_id = "flexjar_virksomheten_din_view"
view_schema = jsonencode(
[
{
mode = "NULLABLE"
name = "uke"
type = "INTEGER"
description = ""
},
{
mode = "NULLABLE"
name = "antall_ja"
type = "INTEGER"
description = ""
},
{
mode = "NULLABLE"
name = "prosent_ja"
type = "FLOAT"
description = ""
},
{
mode = "NULLABLE"
name = "antall_nei"
type = "INTEGER"
description = ""
},
{
mode = "NULLABLE"
name = "prosent_nei"
type = "FLOAT"
description = ""
},
]
)
view_query = <<EOF
SELECT
extract(WEEK FROM opprettet) AS uke,
countif(upper(svar) = 'JA') AS `antall_ja`,
round(countif(upper(svar) = 'JA') / count(*) * 100, 0) AS `prosent_ja`,
countif(upper(svar) = 'NEI') AS `antall_nei`,
round(countif(upper(svar) = 'NEI') / count(*) * 100, 0) AS `prosent_nei`
FROM `${var.gcp_project["project"]}.${google_bigquery_dataset.flex_dataset.dataset_id}.flexjar_feedback_view`
WHERE feedbackId IN ('sykpengesoknad-naering-25-endring', 'sn-virkshomheten-din-survey')
AND opprettet >= TIMESTAMP "2024-11-01 10:43:00+01:00"
GROUP BY uke
ORDER BY uke;
EOF
}

0 comments on commit d940eec

Please sign in to comment.