Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

IF Statement with Match + AND operator in Load Statement

Qlik Community,

I keep getting an 'invalid expression' error specific to the IF statement in my LOAD statement. When I use the same IF statement in a straight table expression it works so I'm wondering there are different syntax requirements for a LOAD statement..

My IF statement is as follows:

,IF(Match(CostCenters,'CC1','CC2') AND Max([ApptHR])-Min([ApptHR]) > 8

  ,1.5

  ,IF(Max([ApptHR])-Min([ApptHR]) > 4

   ,1

   ,0.5))

as ProviderDay


The intent is that only providers in the cost centers CC1 and CC2  who worked more than 8 hours are eligible for a 1.5 day credit, everyone else above 4 hours receives 1 day and below that 0.5 day.

Any insight will be greatly appreciated,

B

Labels (1)
10 Replies
Anonymous
Not applicable
Author

This works... Thank you for your help!