Skip to main content

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Skip the ticket, Chat with Qlik Support instead for instant assistance.
cancel
Showing results for 
Search instead for 
Did you mean: 
Jsobrinho77
Contributor III
Contributor III

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
Creator III
Creator III

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))

Regards, Akash Dhandhi.
If this resolves your Query please like and accept this as an answer.