Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
schneider2037
Creator
Creator

Set Analysis with Less than Or Equal to a Value not working

All - thought this one would be easy, but it's been killing me for an hour:

Data set is for Employees, of which some are Terminated (CurrentStatus = 'T'), and have in the load script calculated the # days from Hire Date to Terminated (DaysToTermination). If there is no Termination Date (i.e. not Terminated), I put a return value of 9,999,999 so that the field DaysToTermination is 100% integers.

The question being asked by management: return the # of employees that were terminated within the first 90 days of hire.

My set expression: 

=count({< EmpStatusCurrent = {'T'} , DaysToTermination = {'<= [90]'} >} distinct [Employee Number])

The above evaluates to 0. So it's doing SOMETHING. Just...not what I'm expecting. Maybe the rows where the EmpStatusCurrent <> T are causing the issue???

When I change to:

=count({< EmpStatusCurrent = {'T'} , DaysToTermination = {'4'} >} distinct [Employee Number])

I get the correct # of employees, so when doing a straight equals, no problem. Just can't figure out the syntax for "Less Than Or Equal to 90."

Any help, oh gurus of Set Analysis, would be MIGHTILY appreciated. I've got a VP looking over my shoulder for ASAP answers!


Thanks in advance,

Jonathan

Labels (2)
1 Solution

Accepted Solutions
Vegar
MVP
MVP

Try this

=count({< EmpStatusCurrent = {'T'} , DaysToTermination = {"<= 90"} >} distinct [Employee Number])

' ' in modifiers are used for static values.

" " in modifiers are used for evaluated values.

View solution in original post

4 Replies
Vegar
MVP
MVP

Try this

=count({< EmpStatusCurrent = {'T'} , DaysToTermination = {"<= 90"} >} distinct [Employee Number])

' ' in modifiers are used for static values.

" " in modifiers are used for evaluated values.

schneider2037
Creator
Creator
Author

Thanks , tried:

=count({< EmpStatusCurrent = {'T'} , DaysToTermination = {"<= 90"} >} distinct [Employee Number])

Still returns 0, unfortunately.

Appreciate the heads up on ' Vs " --> I always just poke-and-hope on single/double quotes!

ashishp
Creator
Creator

I am also facing same isssue, following expression returns 0

=count({< Region = {'Asia'} , NumberOfRows = {"<=1000"} >} distinct [Employee Number])

 

 

 

Vegar
MVP
MVP

@ashishp I don't see any obvious wrongs with your  expression. As long as your spelling is correct. What happens if you create the measure 

=count(distinct [Employee Number])

and manually selects the NumberOfRows values <=1000 and Region=Asia? Is it a valid combination? Do you get the expected value or not?