10 Replies Latest reply: Feb 25, 2018 6:40 PM by Sunny Talwar

# StructuredParameter´s Aggr function bug?

Hi,

recently, I copy an expression from a post and I think there´s a bug.

The expression is:

=Aggr(

If(Rangesum(Above(Sum({1} Sales)/Sum({1} total Sales),1,RowNo()))<0.8, 'A',

If(Rangesum(Above(Sum({1} Sales)/Sum({1} total Sales),1,RowNo()))<0.9, 'B',

'C')),

(Product,(=Sum({1} Sales),Desc))

)

The post is: Recipe for a Pareto Analysis – Revisited

When I copy the expression, the structure parameter is no detected in my Qlik (I use Qlik Sense Desktop, february 2018 version)

As it´s showed in the figure, "desc" is not in blue and it does no works.

Do you think it´s a bug or am I doing something wrong?

• ###### Re: StructuredParameter´s Aggr function bug?

I believe the sort parameter is case sensitive and should be Desc.

• ###### Re: StructuredParameter´s Aggr function bug?

nope; it'll always be black no matter what..

• ###### Re: StructuredParameter´s Aggr function bug?

I´ve tried writting "Desc" and Descendent with the same result

• ###### Re: StructuredParameter´s Aggr function bug?

I've always worked in qlik sense with key words, numeric, ascend and descend;

I mean sthing like:

aggr(rangesum(above(sum(sales),0,rowno())),(Year(numeric,ascend)))

both key words, will show black (as if sense is not considering them), but they do work !

try to add numeric with it (it'll also be black...)

• ###### Re: StructuredParameter´s Aggr function bug?

Your formula is missing a comma after the first 'A' and a close parenthesis after the last Dinero.  See below:

=Aggr(

If(Rangesum(Above(Sum({1} Dinero)/Sum({1} total Dinero),1,RowNo()))<0.8,'A'

If(Rangesum(Above(Sum({1} Dinero)/Sum({1} total Dinero),1,RowNo()))<0.5,'B',

'C')),

(Descripcion,(=Sum({1} Dinero,desc))

)

=Aggr(

If(Rangesum(Above(Sum({1} Sales)/Sum({1} total Sales),1,RowNo()))<0.8, 'A',

If(Rangesum(Above(Sum({1} Sales)/Sum({1} total Sales),1,RowNo()))<0.9, 'B',

'C')),

(Product,(=Sum({1} Sales),Desc))

)

• ###### Re: StructuredParameter´s Aggr function bug?

Thaks Jerry, I think it was a paste mistake, because my qvf was right!

• ###### Re: StructuredParameter´s Aggr function bug?

I don't see why it should not work... I agree that syntax editor isn't the best in detecting this new syntax, but like Omar mentioned it should still work. Would you be able to share a sample where this isn't working? Also, when you say when it isn't working, does the expression show no value in the chart? or does it show unexpected value?

• ###### Re: StructuredParameter´s Aggr function bug?

I´m attaching the qvf file.

The data is not sorted properly using the mentioned expression. That is why I thaugt that the "desc" instruction is not working.

• ###### Re: StructuredParameter´s Aggr function bug?

I believe you problem might be attributed to the negative numbers for Description. The Sum everything is 1,600,549.06 and the value for MAT QUIRURGICOS DE QUIROFANO is 1,376,248.71 which is 85.99%. This is mainly because of the fact that there are -9,458,347.7 from the sum which reduces the positive part down to just 1,600,549.06. What it comes down to is the fact that what are you expecting to see? Do you have an output in mind?

• ###### Re: StructuredParameter´s Aggr function bug?

When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads as HELPFUL if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads as HELPFUL if you feel additional info is useful to others