Using Var in Column expressions with Join Function

Hi Friends

It’s possible to use Var like this?
How to manage this code?
The way I did it doesn’t work

var alq = if (column("ICMS")>0) {column("ICMS")} else column("ICMS_ST");
joinSep("|","0200",column("cProd"),column("xProd"),column("cEAN"),"PC",column("NCM"),alq,column("CEST"))

@AlexanderFillbrunn
Do you know?

Cheers friend.

Hi,
You can, but the way you create the variable does not work. An if cannot be used like an expression. You have to do:

var alq = column("ICMS_ST");
if(...) {
    alq = column("ICMS");
}

Kind regards,
Alexander

2 Likes

Thanks my friend
It worked :slight_smile:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.