Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More efficient implementation of "fixed value -> fixed value" mappings #1713

Open
evansd opened this issue Nov 9, 2023 · 0 comments
Open

Comments

@evansd
Copy link
Contributor

evansd commented Nov 9, 2023

The use case here is using a categorised codelist (e.g. one of the ethnicity codelists) to map codes to categories.

Currently these are implemented using CASE expressions e.g.

CASE
  WHEN code = "abc" THEN "category_1"
  WHEN code = "def" THEN "category_2"
  ELSE "category_3"
END

This appears to have a limit of about 3,000 codes on the TPP database. So far we have not hit this limit.

The way we'll probably want to implement this is to write the mapping to a temporary table and use a JOIN.

This covers the parts of #512 which were not implemented in #1710.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

2 participants