Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
patrickbender
Contributor III
Contributor III

Error in expression

=if(IsNull([col1]),

[col2] + [col3],

[col2]+$(var 1))

var 1 = "Set var1 = Aggr(Sum(if(FGLEDG_Bokföringsdatum <= SVDate and Kontogrupp = 'Intäkt',[FGLEDG_BokförtBelopp_SkaBen])), Projektnr);"

FGLEDG_Bokföringsdatum = data from database

SVDate = datefield (inputfield in report)

Kontogrupp = data from database

FGLEDG_BokförtBelopp_SkaBen = data from database

3 Replies
Anonymous
Not applicable

if your code is in same order, the you try to use var1 before defining it

otherwise does QV complains

patrickbender
Contributor III
Contributor III
Author

HI, thank you for your response

the variable is defined in the load script so it should be alright.

marcus_sommer

Try it in this way:

=if(IsNull([col1]), // maybe len(trim(col1)) = 0 as an alternatively ?

[col2] + [col3],

[col2] + $(var1))

Set var1 = "sum(Aggr(Sum(if(FGLEDG_Bokföringsdatum <= SVDate and Kontogrupp = 'Intäkt',[FGLEDG_BokförtBelopp_SkaBen])), Projektnr));"

- Marcus