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

If statement with a aggr n variable

Hi guys,

I have a variable vTeste like :
=aggr(only({<Date={">=$(=$(PreviousYear))"}>}ColumnA)ColumnaA)

and the expression

if(ColumnB=1,

Text(aggr(concat(ColumnC,','),ColumnC),

$(vTeste))

If I insert the variable content into a column table the result its ok, the problem is when I try to use inside the if statement.

I think the correct is insert the = before the $ like =$(vTeste) but not working inside the if.

Can you help me?

Labels (3)
3 Replies
Chanty4u
MVP
MVP

You can try this out

if(ColumnB = 1,

Text(aggr(concat(ColumnC, ','), ColumnC),

=$(=aggr(only({<Date={">=$(=$(PreviousYear))"}>} ColumnA), ColumnA))))

 

Kushal_Chawda

Remove "=" from variable, then your expression will work fine

Gabbar
Specialist
Specialist

in your 'IF' expression a clossing bracket is missing. There are 5 opening brackets but only 4 are closing brackets.
If my guess about where it is missing is correct try this:
if(ColumnB=1,

Text(aggr(concat(ColumnC,','),ColumnC)),

$(vTeste))