Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
While developing a QlikView report I came across a "general script error" caused by a WHERE clause in a grouped load. It's reproducable using the script pasted below. If I enable logging, the logfile does not contain any more details as to why this error is thrown.
Have I encountered a bug, or is there a logical reason why this shouldn't work?
In the meanwhile I've found a workaround by first constructing a second NoConcatenate table, which I then later concatenate and drop in consecutive separate statements.
NoConcatenate
Tab1:
LOAD * INLINE [
FactRowNo, Factor
1, 0.5
1, 0.3
2, 1
3, 0.9
];
Concatenate (Tab1)
LOAD
1-SUM(Factor) As Factor,
FactRowNo
WHERE
1-SUM(Factor) > 0
GROUP BY
FactRowNo;
LOAD * RESIDENT Tab1;
LogFile:
10/03/2014 11:37:56: General Script Error
10/03/2014 11:37:56: Execution Failed
10/03/2014 11:37:56: Execution finished.
It is not a bug, simply you cannot use an aggregate function in where condition (if it was SQL you could by an embedded Select, in qlik no)
Hope it helps
It is not a bug, simply you cannot use an aggregate function in where condition (if it was SQL you could by an embedded Select, in qlik no)
Hope it helps
In SQL I would indeed use the HAVING clause for this. Good to know nothing similar is supported in Qlik.
Would be nice if the script would throw an error with a textual description stating that these two can't be used together.