Skip to content

Create a custom case expression to set comparison level for one column based on values of another column. #501

Answered by RobinL
DGillamQ asked this question in Q&A
Discussion options

You must be logged in to vote

Hiya. Yes - I think it is possible. I think the syntax in the settings for this column would be something like this. (You'll need other comparison columns, I've just included the specific one you're struggling with)

sql = """
case
when accessibility_settings_string_l is null or accessibility_settings_string_r is null then -1
when
    system_os_vesion_l >= 15 and system_os_vesion_r >= 15
    and accessibility_settings_string_l = accessibility_settings_string_r then 2
when
    system_os_vesion_l < 15 and system_os_vesion_r < 15
    and accessibility_settings_string_l = accessibility_settings_string_r then 1
else 0
end
"""

settings = {
    "link_type": "link_only",

    "comparison_columns":…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by DGillamQ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants