Skip to content
Discussion options

You must be logged in to vote

I can suggest this, but isn't easy to understand it (don't ask me to explain this "IIFE = immediately invoked function expression"..., I'm not a coder or similar, just a curious):

TABLE split(Country, ", ") AS Country, map(split(Country, ", "), (c) => ((x) => {US: "🇺🇸", UK: "🇬🇧", FR: "🇫🇷", PT: "🇵🇹"}[x])(c)) AS Flag
WHERE Country
SORT file.name ASC
  • Country: US, UK isn't the right syntax to a list of values. US, UK is just a string with a comma. That's why you need to use the split() function, with the advantage that the results of this operation are arrays (even if only one value).
  • about the ((x) => { A: 1, B: 2 }[x])(Field), well, don't ask me :) - link

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@ReaderGuy42
Comment options

@AB1908
Comment options

Answer selected by ReaderGuy42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants