Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
kdmarkee
Specialist
Specialist

Aggr function and its sorting property

Would someone be so kind as to provide a sample (maybe a qvw) that shows how the sorting feature of the Aggr function works.  The Online Help describes it but their data and qvw sample does not include the field that they use in the written example.  And when would one use this, just if using an ABOVE or BELOW function?  Thanks.

https://help.qlik.com/en-US/qlikview/12.1/Subsystems/Client/Content/ChartFunctions/aggr.htm

Aggr({SetExpression}[DISTINCT] [NODISTINCT ] expr, StructuredParameter{, StructuredParameter})

StructuredParameter consists of a dimension and optionally, sorting criteria in the format: (Dimension(Sort-type, Ordering))

1 Solution

Accepted Solutions
swuehl
MVP
MVP

No, I think it's saved correctly before uploading.

Maybe a version issue.

Is above what you expect?

If yes, can you double check the sort options of the chart:

2017-10-13 17_18_57-QlikView x64 - [E__Users_Stefan_Downloads_sort issue_3.qvw_].png

First priority should be Account, with a sort by expression like

=Min(RangeSum(Date,Alt(StartTime,0.99999)))

and sort numeric value also checked.

Next three dimensions are sorted by numeric value.

No sort on Code and expression.

View solution in original post

16 Replies
el_aprendiz111
Specialist
Specialist

Hi,

kdmarkee
Specialist
Specialist
Author

I reviewed those items other than pareto and it isn't quite enough for me unfortunately.  Ideally I'd like to see this in action in a sample qvw to really drive it home.

antoniotiman
Master III
Master III

Hi Kris,

see Attachment.

Regards,

Antonio

kdmarkee
Specialist
Specialist
Author

Thanks for those examples, appreciate it.  I'm was trying to see if the sort feature of Aggr would help me solve my row sorting problem with the attached qvw.  If you have time to look at it and offer any advice, that would be great.  Maybe this qvw is as good as it will get; what I ideally want may not be possible.  Thanks.

swuehl
MVP
MVP

I don't think you need the Aggr() function at all here.

Create an expression that defines your sort order, e.g. something like

=Rangesum(Date,StartTime)*1E6 + Account * 1E3 +  +Line

Then sort by this expression

sunny_talwar

Not sure, but may be this sort order

Capture.PNG

kdmarkee
Specialist
Specialist
Author

That is not quite right for my desired result unfortunately.  I need to have all Lines within an Account bunched together, which is why I was using the Aggr to at least accomplish that, that is one of my top requirements for the output.