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

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Trouble with OR

Hi,

I am trying to put together a basic table that gives me the sum of a field where the status meets certain criteria - see below

sum(if(PA_Status = 'O',Approved_LC)) ... this works !

sum(if(PA_Status = 'O' or 'C', Approved_LC)) ... this does not include the rows where the PA_Status is C ...

What is QlikView looking for here in place of OR. Could I use IN('C','O')?

Thanks

Lee





Labels (1)
10 Replies
Not applicable
Author

Hi John,

Going back a little now but the below is still not returning correctly. I have a record that has a PA_Status of 'I' and a Claim_Status of 'U', it is being included in the calculation but I believe that according to the below it shouldn't be.

Do you have any suggestions what I have done wrong here ... it must be something simple that I am overlooking.

Sum(

IF(

match(PA_Status, 'C', 'I', 'O') AND

match(Claim_Status, 'E', 'H', 'O','R', 'B'),

Approved_LC))

Cheers

Lee

Sorry, just to add to that ... if I type it out the ugly way as below ... it returns the record as well ... I have done a view in the database and have pasted the results in below to prove that I am not mad ...

=IF((PA_Status = 'C' OR PA_Status = 'I' OR PA_Status = 'O') AND (Claim_Status = 'E' OR Claim_Status = 'H' OR Claim_Status = 'O' OR Claim_Status = 'R' OR Claim_Status = 'B'), Activity_ID)

ID Claim_Number PA_Status Claim_Status

1580 1217 I U

1580 1305 I U

Sorry ... solved it ... is was something stupid after all. Reload had not worked properly so the status was correct in SQL but incorrect in QlikView.