Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm trying to calculate sum or average of values on the same column/expression using if-clause. For some reason this gives me wrong results.
if(wildmatch(UnitDesc, '*xyz*') = 0,
sum(),
avg()
)
UnitDesc is used as a dimension, so each row should only contain sum or avg calculations, never both on the same row. What is the correct way of doing this in Qlikview?
Nevermind, I had the wrong field-name in my expression. Need to be more careful when having similiar field names in my document.
Sum or Avg of which field?
The syntax is Sum(Field) or Avg(Field)
... Let me know
It's the same field, but I want to use different aggr function depending on the measurement unit
if(wildmatch(UnitDesc, '*xyz*') = 0,
sum(Measurement),
avg(Measurement)
)
The syntax seems correct, could you send your document telling what's wrong?
Thanks
Can you post sample app or current output and expected output?
Nevermind, I had the wrong field-name in my expression. Need to be more careful when having similiar field names in my document.