Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Using If Condition, the set analysis expression is not working

Hi,

In the below expression is not working because of exclution of -=, could you please any one suggest where its wrong.

=If(Title='Nb_Invo',Count({$<[Year]={$(PY)}, [Status]-={'A'}>}DISTINCT [Invoice Number]),

If(Title='Nb_Ship',Count([TransNo))

Regards

Chriss

2 Replies
Gysbert_Wassenaar

Try adding a final ) at the end of your expression:

=If(Title='Nb_Invo',Count({$<[Year]={$(PY)}, [Status]-={'A'}>}DISTINCT [Invoice Number]),If(Title='Nb_Ship',Count([TransNo)))

The expression editor has a bug so -= will show a red underline. But the syntax is correct. If the expression doesn't calculate the correct result it's not because [Status]-={'A'} isn't the right syntax.


talk is cheap, supply exceeds demand
MayilVahanan

HI

If your  full expression is

=If(Title='Nb_Invo',Count({$<[Year]={$(PY)}, [Status]-={'A'}>}DISTINCT [Invoice Number]),

If(Title='Nb_Ship',Count([TransNo)) only means,

You didn't closed the if condition

=If(Title='Nb_Invo',Count({$<[Year]={$(PY)}, [Status]-={'A'}>}DISTINCT [Invoice Number]),

If(Title='Nb_Ship',Count([TransNo)))

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