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

Add Or function in expression

Hello together, 

I am using the below expression.

AGGR(If(Count([Text1])>1,'Match'),[Text1])

It works fine
Now I want to add the same with Text2 using +.
It shows OK but the expression does not work. 

AGGR(If(Count([Text1])>1,'Match'),[Text1])
+
AGGR(If(Count([Text2])>1,'Match'),[Text2])

Thanks in advance. 

1 Solution

Accepted Solutions
salonicdk28
Creator II
Creator II

Or you can try this-

sum(aggr(If(Count([Text1])>1 or Count([Text2])>1,'Match'),[Text1],[Text2] ))

View solution in original post

7 Replies
rbartley
Specialist II
Specialist II

Could you please post your app, or at least the data you are using and explain what you mean by: "It shows OK but the expression does not work". 

Daniel1908
Creator
Creator
Author

Daniel1908_0-1631176347588.png

If I just use one of both it brings me some data with the equal text. 

AGGR(If(Count([Text1])>1,'Match'),[Text1])
+
AGGR(If(Count([Text2])>1,'Match'),[Text2])

rbartley
Specialist II
Specialist II

Please post your data in an Excel spreadsheet or other (removing anything confidential) so that I can look into it.

MayilVahanan

HI

AGGR(If(Count([Text1])>1,'Match'),[Text1])
+
AGGR(If(Count([Text2])>1,'Match'),[Text2])

-- It means, you are adding Match + Match , it doesn't possible to add Text . 

I think, you want to display Match when Text1 or Text2 is greater than 1? if so, try like below

If(Count(Text1) > 1 or Count(Text2)> 1, 'Match'))

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
salonicdk28
Creator II
Creator II

Or you can try this-

sum(aggr(If(Count([Text1])>1 or Count([Text2])>1,'Match'),[Text1],[Text2] ))

sunny_talwar

Are you trying to do this?

Aggr(If(Count([Text1]) > 1, 'Match Text1'), [Text1])
& ' and ' &
Aggr(If(Count([Text2]) > 1, 'Match Text2'), [Text2])
Daniel1908
Creator
Creator
Author

This worked fine, thanks. 

aggr(If(Count([Text1])>1 or Count([Text2])>1,'Match'),[Text1],[Text2] ))