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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

sum(if(Aggr(sum( not allowed

Hi,

does anyone understand why qlikview does not accept an if statement around the following?

sum(if(Aggr(
      
sum({< eng_costcenter_key = {$(vCostCenter)},hours_month = {'$(=date($(vReportingDate)))'}, Z_directe_code_flag = {1},statusCode={'OPN'}>} timeAmount),
      
engagementId) = 0, 1))

example:

if(

sum(if(Aggr(
      
sum({< eng_costcenter_key = {$(vCostCenter)},hours_month = {'$(=date($(vReportingDate)))'}, Z_directe_code_flag = {1},statusCode={'OPN'}>} timeAmount),
      
engagementId) = 0, 1))

>1, do something) is not allowed.

thank you


3 Replies
gussfish
Creator II
Creator II

In what context are you using this statement?  e.g. is it for the color of a calculated dimension of a bar chart, or the value of a variable that's used in an expression in a ...

And in what sense does QlikView not accept the statement?  If it's merely that the expression editor is putting red squiggly lines under it, but it otherwise is producing correct results, that's not really an issue.  So what is the precise symptom?

Not applicable
Author

Hi, thanks.

Well it does not return any values.  (only -), if I remove the outer if, it works fine.

for your information. I am creating a kpi dashboard. So in one table, i put: if kpi is 11 then..... (the aggr function)

if 12, then some other...

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

Can you run the first example in a tex box, or is it only useful as a chart expression? Better still, I suggest that you post your model, or a sample, to help disagnose the problem.

Regards

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein