Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

What means -1 in comparision

Hi,

I have the expression:

getSelectedCount(Field_Name), which returns 1 (One value selected).

But if I type getSelectedCount(Field_Name) = 1, it returns -1!

What does that mean?

Thanks!

1 Solution

Accepted Solutions
Gysbert_Wassenaar

-1 means True. 0 is False, any other number then 0 is treated as True.


talk is cheap, supply exceeds demand

View solution in original post

5 Replies
Gysbert_Wassenaar

-1 means True. 0 is False, any other number then 0 is treated as True.


talk is cheap, supply exceeds demand
Peter_Cammaert
Partner - Champion III
Partner - Champion III

For a slightly more expanded explanation, see Matematical Constants and Parameter-Free Functions in QV Desktop Help. But only slightly

True and False are dual() values, as is usual in QlikView. You just met the numerical part.

Peter

SreeniJD
Specialist
Specialist

Hi Angel,

QV returns -1 if condition is true. Wierd but true.

Sreeni

Not applicable
Author

Thanks, I thought there should be a reason for that. I'll try to find out.


Anonymous
Not applicable
Author

As is oft the case HIC has written a good blog post on this :

     On Boolean Fields and Functions