Skip to content

Use field value as function parameter #36

@aguspina

Description

@aguspina

I'm trying to exec this query in Superset-SQLab

SELECT {{gender_enum(users.gender)}} as gender
from users;

The gender_enum is defined like this

lambda x: ['Femenino', 'Masculino', 'Otro', 'Prefiere no decir'][x]

The gender field could be 0, 1, 2 or 3. It's an enum.

Of course, in jinja context, users.gender does not exist. I'm not finding a way to solve this, can you help me please?

Thanks!!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions