Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
AWS Degraded - You may experience Community slowness, timeouts, or trouble accessing: LATEST HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
sgrewal
Contributor
Contributor

If with and statements not working

Hi, 

 

I am trying to create a calculated field and it only works if there is one criteria and I can not use and or as the condition expression. 

I also tried putting parantheses like this (saw it mentioned in a different post) :if(([Count]>26 and [Count ]<51),1,0)

sgrewal_0-1669149304613.png

 

Labels (2)
1 Solution

Accepted Solutions
Or
MVP
MVP

Data Manager does not allow the use of AND / OR. Either switch to using the Data Load Editor, or write your statements as nested if(), e.g. If(POQTY >=1, if(POQTE <=3,1,0),0)

View solution in original post

4 Replies
Frank_S
Support
Support

Try it this way...
=If(Count(OrderID) >=1 and Count(OrderID) <=3, 1,0)

In your case

=If(Count(Your_dimension) >=26 and Count(Your_dimension) <=51, 1,0)

 

Or if you have a space in your dimension name, use:

=If(Count([OrderID]) >=26 and Count([OrderID]) <=51, 1,0)

 

Kind regards...

 

 

Please remember hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
sgrewal
Contributor
Contributor
Author

Looks like that does not work.

It is showing a right parentheses error.

But all are present.

[cid:image001.png@01D8FF1D.54B4A910]


sgrewal
Contributor
Contributor
Author

The image did not upload so here it is

sgrewal_0-1669213506941.png

 

Or
MVP
MVP

Data Manager does not allow the use of AND / OR. Either switch to using the Data Load Editor, or write your statements as nested if(), e.g. If(POQTY >=1, if(POQTE <=3,1,0),0)