Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

Error in expression with count aggregation and if statement

Hello hello,

I want to calculate the portfolio but I get an error in my expression.

COUNT (IF(MonthYear_Start<=Master_MonthYear AND
Relevant_Sales=1 AND
Contract_Status_Code -=0 AND
Contract_Status_Code -= 10 AND
(ISNULL(Month_End_Real)=-1 OR MonthYear_End_Real>=Master_MonthYear)), Contract_Key)

Error: "Error in expression: ')' expected"

I hope/think its a small mistake but I don't get it

Is it right that -= is in Qlik Sense the new <> (NOT EQUAL)?

2 Replies

Re: Error in expression with count aggregation and if statement

=COUNT(

  IF(MonthYear_Start<=Master_MonthYear AND Relevant_Sales=1 AND Contract_Status_Code <> 0 AND Contract_Status_Code <> 10 AND

  (ISNULL(Month_End_Real)<> 1 OR MonthYear_End_Real >= Master_MonthYear), Contract_Key))

Not applicable

Re: Error in expression with count aggregation and if statement

We modified our data model to a canonical date like here: Canonical Date

After that it was simple to calculate it.

Thank you anyway!!