You can do that by using if as an expression and assembling list of values finally concatenating them together:
IO.iodata_to_binary([
if(data["a"] > 0, do: "text1", else: ""),
if(data["b"] > 0, do: "text2", else: ""),
if(data["c"] > 0, do: "text3", else: "")
])
You could even extract the if to a separate function, if the pattern if very repeating:
defp if_positive(value, text), do: if(value > 0, do: text, else: "")
IO.iodata_to_binary([
if_positive(data["a"], "text1"),
if_positive(data["b"], "text2"),
if_positive(data["c"], "text3")
])


















