Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save julietaansola/f26d187530e0201240290d5748fc2d48 to your computer and use it in GitHub Desktop.
Save julietaansola/f26d187530e0201240290d5748fc2d48 to your computer and use it in GitHub Desktop.
Estos querys creo q son los personalizados
/* QuickSight c428a729-2b98-457d-a02a-04fa82489efd */
SELECT *
FROM (
SELECT "transaction" AS "08c4c336-917f-4f61-8afd-75b7a963d90f.transaction", "transaction_id" AS "08c4c336-917f-4f61-8afd-75b7a963d90f.transaction_id", "transaction_date" AS "08c4c336-917f-4f61-8afd-75b7a963d90f.transaction_date", "transaction_dia" AS "08c4c336-917f-4f61-8afd-75b7a963d90f.transaction_dia", "transaction_hour" AS "08c4c336-917f-4f61-8afd-75b7a963d90f.transaction_hour", "movement_tx" AS "08c4c336-917f-4f61-8afd-75b7a963d90f.movement_tx", "movement_id" AS "08c4c336-917f-4f61-8afd-75b7a963d90f.movement_id", "description_ok" AS "08c4c336-917f-4f61-8afd-75b7a963d90f.description_ok", "amount" AS "08c4c336-917f-4f61-8afd-75b7a963d90f.amount", "amount_abs" AS "08c4c336-917f-4f61-8afd-75b7a963d90f.amount_abs", "is_qr" AS "08c4c336-917f-4f61-8afd-75b7a963d90f.is_qr", "details" AS "08c4c336-917f-4f61-8afd-75b7a963d90f.details", "origin_id" AS "08c4c336-917f-4f61-8afd-75b7a963d90f.origin_id", "extref_origin" AS "08c4c336-917f-4f61-8afd-75b7a963d90f.extref_origin", "origin_name" AS "08c4c336-917f-4f61-8afd-75b7a963d90f.origin_name", "origin_document" AS "08c4c336-917f-4f61-8afd-75b7a963d90f.origin_document", "origin_type_ok" AS "08c4c336-917f-4f61-8afd-75b7a963d90f.origin_type_ok", "tx_origin_id" AS "08c4c336-917f-4f61-8afd-75b7a963d90f.tx_origin_id", "tx_extref_origin" AS "08c4c336-917f-4f61-8afd-75b7a963d90f.tx_extref_origin", "tx_origin_name" AS "08c4c336-917f-4f61-8afd-75b7a963d90f.tx_origin_name", "tx_origin_document" AS "08c4c336-917f-4f61-8afd-75b7a963d90f.tx_origin_document", "tx_origin_type_ok" AS "08c4c336-917f-4f61-8afd-75b7a963d90f.tx_origin_type_ok", "origin_balance" AS "08c4c336-917f-4f61-8afd-75b7a963d90f.origin_balance", "origin_tipo_persona" AS "08c4c336-917f-4f61-8afd-75b7a963d90f.origin_tipo_persona", "tipo_tx" AS "08c4c336-917f-4f61-8afd-75b7a963d90f.tipo_tx", "fecha_creacion_cuenta" AS "08c4c336-917f-4f61-8afd-75b7a963d90f.fecha_creacion_cuenta", "fecha_eliminacion_cuenta" AS "08c4c336-917f-4f61-8afd-75b7a963d90f.fecha_eliminacion_cuenta", "target" AS "08c4c336-917f-4f61-8afd-75b7a963d90f.target", "target_name" AS "08c4c336-917f-4f61-8afd-75b7a963d90f.target_name", "target_document" AS "08c4c336-917f-4f61-8afd-75b7a963d90f.target_document", "target_type_ok" AS "08c4c336-917f-4f61-8afd-75b7a963d90f.target_type_ok", CAST("private" AS INTEGER) AS "08c4c336-917f-4f61-8afd-75b7a963d90f.private", "t2t_emisor_extref" AS "08c4c336-917f-4f61-8afd-75b7a963d90f.t2t_emisor_extref", "t2t_emisor_nombre" AS "08c4c336-917f-4f61-8afd-75b7a963d90f.t2t_emisor_nombre", "t2t_emisor_document" AS "08c4c336-917f-4f61-8afd-75b7a963d90f.t2t_emisor_document", "mes_año" AS "08c4c336-917f-4f61-8afd-75b7a963d90f.mes_año"
FROM "bi"."vw_transaction"
) AS "t"
FULL JOIN (
SELECT "id" AS "f48acac9-d6cc-4971-a880-15d62ce913b7.id", "username" AS "f48acac9-d6cc-4971-a880-15d62ce913b7.username", "email" AS "f48acac9-d6cc-4971-a880-15d62ce913b7.email", "phone" AS "f48acac9-d6cc-4971-a880-15d62ce913b7.phone", "device_id" AS "f48acac9-d6cc-4971-a880-15d62ce913b7.device_id", "external_ref" AS "f48acac9-d6cc-4971-a880-15d62ce913b7.external_ref", "version_app" AS "f48acac9-d6cc-4971-a880-15d62ce913b7.version_app", "version_os" AS "f48acac9-d6cc-4971-a880-15d62ce913b7.version_os", CAST("prueba_vida" AS INTEGER) AS "f48acac9-d6cc-4971-a880-15d62ce913b7.prueba_vida", "nombre_person" AS "f48acac9-d6cc-4971-a880-15d62ce913b7.nombre_person", "apellido_person" AS "f48acac9-d6cc-4971-a880-15d62ce913b7.apellido_person", "nombre_completo_person" AS "f48acac9-d6cc-4971-a880-15d62ce913b7.nombre_completo_person", "documento_person" AS "f48acac9-d6cc-4971-a880-15d62ce913b7.documento_person", "fecha_nacimiento_person" AS "f48acac9-d6cc-4971-a880-15d62ce913b7.fecha_nacimiento_person", "cuit_person" AS "f48acac9-d6cc-4971-a880-15d62ce913b7.cuit_person", CAST("persona_expuesta" AS INTEGER) AS "f48acac9-d6cc-4971-a880-15d62ce913b7.persona_expuesta", "direccion_completa_person" AS "f48acac9-d6cc-4971-a880-15d62ce913b7.direccion_completa_person", "codpostal_real_person" AS "f48acac9-d6cc-4971
/* QuickSight d44ad9d4-060e-493a-a317-49327f9af842 */
SELECT "t"."d53cbcf5-2cb5-4762-b61d-82bf402c6b78.transaction" AS "transaction", "t"."d53cbcf5-2cb5-4762-b61d-82bf402c6b78.transaction_id" AS "transaction_id", "t"."d53cbcf5-2cb5-4762-b61d-82bf402c6b78.transaction_date" AS "transaction_date", "t"."d53cbcf5-2cb5-4762-b61d-82bf402c6b78.transaction_dia" AS "transaction_dia", "t"."d53cbcf5-2cb5-4762-b61d-82bf402c6b78.transaction_hour" AS "transaction_hour", "t"."d53cbcf5-2cb5-4762-b61d-82bf402c6b78.movement_tx" AS "movement_tx", "t"."d53cbcf5-2cb5-4762-b61d-82bf402c6b78.movement_id" AS "movement_id", "t"."d53cbcf5-2cb5-4762-b61d-82bf402c6b78.description_ok" AS "description_ok", "t"."d53cbcf5-2cb5-4762-b61d-82bf402c6b78.amount" AS "amount", "t"."d53cbcf5-2cb5-4762-b61d-82bf402c6b78.amount_abs" AS "amount_abs", "t"."d53cbcf5-2cb5-4762-b61d-82bf402c6b78.is_qr" AS "is_qr", "t"."d53cbcf5-2cb5-4762-b61d-82bf402c6b78.details" AS "details", "t"."d53cbcf5-2cb5-4762-b61d-82bf402c6b78.origin_id" AS "origin_id", "t"."d53cbcf5-2cb5-4762-b61d-82bf402c6b78.extref_origin" AS "extref_origin", "t"."d53cbcf5-2cb5-4762-b61d-82bf402c6b78.origin_name" AS "origin_name", "t"."d53cbcf5-2cb5-4762-b61d-82bf402c6b78.origin_document" AS "origin_document", "t"."d53cbcf5-2cb5-4762-b61d-82bf402c6b78.origin_type_ok" AS "origin_type_ok", "t"."d53cbcf5-2cb5-4762-b61d-82bf402c6b78.tx_origin_id" AS "tx_origin_id", "t"."d53cbcf5-2cb5-4762-b61d-82bf402c6b78.tx_extref_origin" AS "tx_extref_origin", "t"."d53cbcf5-2cb5-4762-b61d-82bf402c6b78.tx_origin_name" AS "tx_origin_name", "t"."d53cbcf5-2cb5-4762-b61d-82bf402c6b78.tx_origin_document" AS "tx_origin_document", "t"."d53cbcf5-2cb5-4762-b61d-82bf402c6b78.tx_origin_type_ok" AS "tx_origin_type_ok", "t"."d53cbcf5-2cb5-4762-b61d-82bf402c6b78.origin_balance" AS "origin_balance", "t"."d53cbcf5-2cb5-4762-b61d-82bf402c6b78.origin_tipo_persona" AS "origin_tipo_persona", "t"."d53cbcf5-2cb5-4762-b61d-82bf402c6b78.tipo_tx" AS "tipo_tx", "t"."d53cbcf5-2cb5-4762-b61d-82bf402c6b78.fecha_creacion_cuenta" AS "fecha_creacion_cuenta", "t"."d53cbcf5-2cb5-4762-b61d-82bf402c6b78.fecha_eliminacion_cuenta" AS "fecha_eliminacion_cuenta", "t"."d53cbcf5-2cb5-4762-b61d-82bf402c6b78.target" AS "target", "t"."d53cbcf5-2cb5-4762-b61d-82bf402c6b78.target_name" AS "target_name", "t"."d53cbcf5-2cb5-4762-b61d-82bf402c6b78.target_document" AS "target_document", "t"."d53cbcf5-2cb5-4762-b61d-82bf402c6b78.target_type_ok" AS "target_type_ok", "t"."d53cbcf5-2cb5-4762-b61d-82bf402c6b78.private" AS "private", "t"."d53cbcf5-2cb5-4762-b61d-82bf402c6b78.t2t_emisor_extref" AS "t2t_emisor_extref", "t"."d53cbcf5-2cb5-4762-b61d-82bf402c6b78.t2t_emisor_nombre" AS "t2t_emisor_nombre", "t"."d53cbcf5-2cb5-4762-b61d-82bf402c6b78.t2t_emisor_document" AS "t2t_emisor_document", "t"."d53cbcf5-2cb5-4762-b61d-82bf402c6b78.mes_año" AS "mes_año", "t"."d53cbcf5-2cb5-4762-b61d-82bf402c6b78.tx_activa" AS "tx_activa", "t"."d53cbcf5-2cb5-4762-b61d-82bf402c6b78.fecha_tx_activa" AS "fecha_tx_activa", "t0"."94fc9859-4d29-4962-b7b7-462eb8c67583.id" AS "id", "t0"."94fc9859-4d29-4962-b7b7-462eb8c67583.username" AS "username", "t0"."94fc9859-4d29-4962-b7b7-462eb8c67583.email" AS "email", "t0"."94fc9859-4d29-4962-b7b7-462eb8c67583.phone" AS "phone", "t0"."94fc9859-4d29-4962-b7b7-462eb8c67583.device_id" AS "device_id", "t0"."94fc9859-4d29-4962-b7b7-462eb8c67583.external_ref" AS "external_ref", "t0"."94fc9859-4d29-4962-b7b7-462eb8c67583.version_app" AS "version_app", "t0"."94fc9859-4d29-4962-b7b7-462eb8c67583.version_os" AS "version_os", "t0"."94fc9859-4d29-4962-b7b7-462eb8c67583.prueba_vida" AS "prueba_vida", "t0"."94fc9859-4d29-4962-b7b7-462eb8c67583.nombre_person" AS "nombre_person", "t0"."94fc9859-4d29-4962-b7b7-462eb8c67583.apellido_person" AS "apellido_person", "t0"."94fc9859-4d29-4962-b7b7-462eb8c67583.nombre_completo_person" AS "nombre_completo_person", "t0"."94fc9859-4d29-4962-b7b7-462eb8c67583.documento_person" AS "documento_person", "t0"."94fc9859-4d29-4962-b7b7-462eb8c67583.fecha_nacimiento_person" AS "fecha_nacimiento_person", "t0"."94fc9859-4d29-4962-b7b7-462eb8c67583.cuit_
Este query arma base_full_tap
/* QuickSight 9c89f9c0-c926-47db-afc7-3e58b34a9c89 */
SELECT "vw_transaction"."transaction" AS "transaction[vw_transaction]", "vw_transaction"."transaction_id", "vw_transaction"."transaction_date", "vw_transaction"."transaction_dia", "vw_transaction"."transaction_hour", "vw_transaction"."movement_tx", "vw_transaction"."movement_id", "vw_transaction"."description_ok", "vw_transaction"."amount" AS "amount[vw_transaction]", "vw_transaction"."amount_abs", "vw_transaction"."is_qr", "vw_transaction"."details", "vw_transaction"."origin_id" AS "origin_id[vw_transaction]", "vw_transaction"."extref_origin" AS "extref_origin[vw_transaction]", "vw_transaction"."origin_name", "vw_transaction"."origin_document", "vw_transaction"."origin_type_ok", "vw_transaction"."tx_origin_id", "vw_transaction"."tx_extref_origin", "vw_transaction"."tx_origin_name", "vw_transaction"."tx_origin_document", "vw_transaction"."tx_origin_type_ok", "vw_transaction"."origin_balance", "vw_transaction"."origin_tipo_persona", "vw_transaction"."tipo_tx", "vw_transaction"."fecha_creacion_cuenta", "vw_transaction"."fecha_eliminacion_cuenta", "vw_transaction"."target", "vw_transaction"."target_name", "vw_transaction"."target_document", "vw_transaction"."target_type_ok", CAST("vw_transaction"."private" AS INTEGER) AS "private", "vw_transaction"."t2t_emisor_extref", "vw_transaction"."t2t_emisor_nombre", "vw_transaction"."t2t_emisor_document", "vw_full_account"."id", "vw_full_account"."username", "vw_full_account"."email", "vw_full_account"."phone", "vw_full_account"."device_id", "vw_full_account"."external_ref", "vw_full_account"."version_app", "vw_full_account"."version_os", CAST("vw_full_account"."prueba_vida" AS INTEGER) AS "prueba_vida", "vw_full_account"."nombre_person", "vw_full_account"."apellido_person", "vw_full_account"."nombre_completo_person", "vw_full_account"."documento_person", "vw_full_account"."fecha_nacimiento_person", "vw_full_account"."cuit_person", CAST("vw_full_account"."persona_expuesta" AS INTEGER) AS "persona_expuesta", "vw_full_account"."direccion_completa_person", "vw_full_account"."codpostal_real_person", "vw_full_account"."latitud_person", "vw_full_account"."longitud_person", "vw_full_account"."codpostal_person", "vw_full_account"."localidad_person", "vw_full_account"."departamento_person", "vw_full_account"."provincia_person", "vw_full_account"."nombre_compañía", "vw_full_account"."nombre_dueño", "vw_full_account"."documento_compañía", "vw_full_account"."business_sector", "vw_full_account"."direccion_completa_company", "vw_full_account"."latitud_company", "vw_full_account"."longitud_company", "vw_full_account"."direccion_company", "vw_full_account"."codpostal_company", "vw_full_account"."localidad_company", "vw_full_account"."departamento_company", "vw_full_account"."provincia_company", "vw_promotion_completa"."created_at", "vw_promotion_completa"."tx", "vw_promotion_completa"."amount" AS "amount[vw_promotion_completa]", "vw_promotion_completa"."origin_id" AS "origin_id[vw_promotion_completa]", "vw_promotion_completa"."codigo", "vw_promotion_completa"."transaction" AS "transaction[vw_promotion_completa]", "vw_promotion_completa"."subtransaction", "vw_acumulados"."extref_origin" AS "extref_origin[vw_acumulados]", "vw_acumulados"."acumulado_mide", "vw_acumulados"."acumulado_edenor", "vw_acumulados"."acumulado_aysa", "vw_acumulados"."acumulado_metrogas", "vw_acumulados"."fecha_ult_tx_mide", "vw_acumulados"."fecha_ult_tx_edenor", "vw_acumulados"."fecha_ult_tx_metrogas", "vw_acumulados"."fecha_ult_tx_aysa"
FROM "bi"."vw_transaction"
LEFT JOIN "bi"."vw_full_account" ON "vw_transaction"."extref_origin" = "vw_full_account"."external_ref"
LEFT JOIN "bi"."vw_promotion_completa" ON "vw_transaction"."transaction" = "vw_promotion_completa"."transaction"
LEFT JOIN "bi"."vw_acumulados" ON "vw_transaction"."extref_origin" = "vw_acumulados"."extref_origin"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment