Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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))
Still, should be possible without advanced aggregation.
I am not quite sure why your requested result shows account 60 before 66 and 70 before 77 (if the overall sort should be based on Date + Starttime).
Maybe have a look at this attached version.
You are right, I had a few rows pasted in the wrong place in the desired result image...I missed that. That aside however, this solution won't work because I need to also keep all lines of an account together, so for example the row with account 22 line 1 needs to be placed after the row with account 22 line 99. Its a complex requirement, its like I have nested sorting rules to implement...and maybe it is not even possible in Qlik
Have you checked my last attachment?
Date | StartTime | Account | Line | Code | sum(Units) |
---|---|---|---|---|---|
99 | |||||
1/1/2017 | 12:00:00 AM | 22 | 2 | 93312 | 0 |
1/1/2017 | 12:00:00 AM | 22 | 3 | 93503 | 0 |
1/1/2017 | 12:00:00 AM | 22 | 4 | 36620 | 0 |
1/1/2017 | 12:00:00 AM | 22 | 5 | 76937 | 0 |
1/1/2017 | 12:00:00 AM | 22 | 6 | 99140 | 0 |
1/1/2017 | 12:00:00 AM | 22 | 99 | 99100 | 0 |
1/1/2017 | 3:55:00 PM | 22 | 1 | 33405 | 0 |
1/1/2017 | 12:00:00 AM | 33 | 2 | 93312 | 0 |
1/1/2017 | 12:00:00 AM | 33 | 3 | 93503 | 0 |
1/1/2017 | 12:00:00 AM | 33 | 4 | 36620 | 0 |
1/1/2017 | 12:00:00 AM | 33 | 5 | 76937 | 0 |
1/1/2017 | 12:00:00 AM | 33 | 6 | 99140 | 0 |
1/1/2017 | 9:45:00 PM | 33 | 1 | 33860 | 0 |
1/1/2017 | 12:00:00 AM | 99 | 2 | 93312 | 0 |
1/1/2017 | 12:00:00 AM | 99 | 3 | 93503 | 0 |
1/1/2017 | 12:00:00 AM | 99 | 4 | 36620 | 0 |
1/1/2017 | 12:00:00 AM | 99 | 5 | 76937 | 0 |
1/1/2017 | 12:00:00 AM | 99 | 6 | 99140 | 0 |
1/1/2017 | 12:00:00 AM | 99 | 99 | 99100 | 0 |
1/1/2017 | 7:40:00 AM | 99 | 1 | 33405 | 0 |
1/1/2017 | 7:00:00 AM | 11 | 1 | 55555 | 1 |
1/1/2017 | 9:00:00 AM | 10 | 2 | 55555 | 2 |
1/2/2017 | 44 | 1 | PC | 0 | |
1/2/2017 | 55 | 1 | NC | 32 | |
1/3/2017 | 4:38:00 PM | 20 | 1 | 23515 | 0 |
1/3/2017 | 30 | 1 | NC | 32 | |
1/4/2017 | 12:00:00 AM | 40 | 2 | 99140 | 0 |
1/4/2017 | 7:18:00 PM | 40 | 1 | 11042 | 0 |
1/4/2017 | 12:00:00 AM | 66 | 2 | 93312 | 0 |
1/4/2017 | 12:00:00 AM | 66 | 3 | 36620 | 0 |
1/4/2017 | 7:21:00 AM | 66 | 1 | 33975 | 0 |
1/4/2017 | 12:00:00 AM | 77 | 2 | 36620 | 0 |
1/4/2017 | 12:00:00 AM | 77 | 3 | 99100 | 0 |
1/4/2017 | 5:29:00 PM | 77 | 1 | 27245 | 0 |
1/4/2017 | 1:27:00 PM | 60 | 1 | 11042 | 0 |
1/4/2017 | 3:40:00 PM | 70 | 1 | 50592 | 0 |
1/4/2017 | 8:30:00 PM | 80 | 1 | 19367 | 0 |
1/4/2017 | 90 | 1 | ND | 32 |
Ok this is really weird... I did look at your sort issue_3.qvw but here is what it looks like on my end. Is it possible you uploaded the qvw prior to saving it maybe? I hope it is just something simple like that. And not sure it matters, but I am on QV 12.10. Thanks again.
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:
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.
The 12.1 version seems to have changed indeed the sort priority when opening the app.
It seems you just need to put Account dimension on top of the sort list.
The version I downloaded had the Account listed third in the Sort Priority and I had just starting playing with that order when you responded, so that was it. So this seems to work, even for my actual qvw which has a lot of "real" data. Thank you so much...I didn't think I'd get to fulfill all the requirements on this one but with your help I can. Thanks again!