Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I'm trying to make an expression in a text block. The expression is:
=SUM(if(TIPO_ALMACENAMIENTO='MAI' AND MES=MaxString(MES), INSTALADO))
the problem is in the expresion MES=MaxString(MES), if I put MES='dic.' there is any problems but when I use the expresion MaxString(MES) the text block, it show me the error
ERROR in expresion Nested aggregtion not allowed
the function MaxString(MES) throw me dic. but I need 'dic.'
How can I solve this?
I want to put the max month of the year that I have information
Thank you very much!
Try:
=SUM(if(TIPO_ALMACENAMIENTO='MAI' AND MES='$(=MaxString(MES))', INSTALADO))
Not sure if I understand this correctly but try this:
Mes=Month(Max(Date))
What context do you need to evaluate 'Maxstring(MES)' ? At the application level or row by row ?
If its just once at the application level, you could try precalculating that value outside the expression using a variable. Create a variable vMaxMes with an expression: '=MaxString(MES)' . Be sure to keep the leading '=' sign with the expression so that is evaluates BEFORE the other expression .
Then reference the precalculated variable as follows.
SUM(if(TIPO_ALMACENAMIENTO='MAI' AND MES=$(vMaxMes), INSTALADO))
This approach won't work if you have to calculate MaxMes differently on a chart row by row basis, becuase it will evaluate to just one value for the whole app.
this throw me dic. but I need 'dic.'
If i put mes =dic. qlik throw me ERROR in expresion Nested aggregtion not allowed but if I put mes='dic.' everything run ok
I need to evaluate in a chart but I'm proving this firts in a text block to know it's run ok or not
Try:
=SUM(if(TIPO_ALMACENAMIENTO='MAI' AND MES='$(=MaxString(MES))', INSTALADO))
may be
=sum(aggr(if(TIPO_ALMACENAMIENTO='MAI' AND MES=MaxString(MES), INSTALADO), ID))