Submitted by viking on 2023/07/15 21:43

I have read this section: 5. Sorting and Grouping Items (but it is difficult to grasp 100% in all sorting situations..)
I would like to sort the Context parents independent of the items (which may not always be at the same levels)

Consider first this simplified example w/o any sorting:

z

I then sort by sort bar (and I have selected "Sort Items and Sub-Items" - which I also need to have selected in my real grid)"

z

The items are then sorted as expected by the "Sort1" column and the context parent order is unchanged. However after a refresh, the context parent order is changed:
z
Why is the context parent order changed, and can I control the sort order of the context parents independent of the sort bar criteria?

Comments

In my experience, you cannot sort the context parents above the grid TLI. The sort bar refers to the items belonging to the grid, which the context parents are not.

As I mentioned in the other thread, for sorting and grouping I've found that you get the best results when the grid source is the set of items that you want to work with.

For multi-level sort you need to use the source bar sort with | to separate the levels. You can sort levels below the TLI, but not the levels above. 

 

That is actually my point. I do not want the context parents to be sorted per se. I want the sort order ("unsorted") to remain and only sort the items using the sort bar. However, after a refresh, the context parents are sorted anyway, but I do not understand why and how they are sorted (i.e. what determines their sort order?).

Hi,

It is quite simple and logical (of course it is logical, this is InfoQube lol)

  1. Source bar acts on source items (source, filter, sort, alpha-filter, date filter)
  2. Grid sort and grid/column filters act on grid items. Grid items are items displayed in the grid, which in this case also includes context parent items

So if you use source sort (i.e. source bar), you will sort source items and possibly sub-items. This excludes context parents. If you use grid sort (i.e. sort bar), sort is performed on TLI and possibly sub-items (TLI are the top level items, which could be context parents as in your example)

So viking, you're using grid sort, so your context parents (which are TLI in this case) will sort. No way out. The order is undetermined in this case as they all have a blank Sort1 field value

You have 2 options, both will work :

  1. Enter values for your context parents, dummy values used for sorting
  2. Drag the Item field to the sort bar, it will sort items by the item field which would do the trick for you

Hope this is clear and remember to use IQ optimally, it helps to deeply understand how it works

So in summary, Source sort cannot sort context parents (as they are not part of the source) and grid/column sort cannot distinguish between context parents and other items as they are all "items"

Pierre_Admin
IQ Designer

FYI: easiest way to reference pages is to use the (node:nodeid) syntax with square brackets [  ] instead of (  )

Hope this is clear and remember to use IQ optimally, it helps to deeply understand how it works

I 100% agree. However, few users got a good grasp of Ecco Pro and that was a much simpler program than IQ. I wonder how many IQ users deeply understand IQ? I am trying to, but it is not easy...

You have 2 options, both will work :

  1. Enter values for your context parents, dummy values used for sorting
  2. Drag the Item field to the sort bar, it will sort items by the item field which would do the trick for you

1. That would unfortunately not work in my case, as I am constantly adding context parents and I would often need to redo the dummy values (or try to figure out what new values to insert)

2. That would unfortunately also not work in my case as it would sort the other "regular TLI" items in the wrong order.

3. A temporary solution is to sort the items column by Column>Sort Items ascending. However, that sort disappears after a refresh.

4. Based on what you wrote above, I turned of any sorting and tried to sort the Context Parents manually. However, the manual sort order disappeared after a refresh. Why?? I guess that context parents can not be sorted this way, only "regular" items? (The idea was that I may then be able to sort the "regular" items by source sort instead of sort bar, which ignores the Context Parents). This would have been the best solution if it had worked....

5. The only solution that I could figure out, albeit a bit complex, is to create a new text Column "CP Sort" and copy the context parent item text to this column and use this as the first sort sort bar criteria. Because I am constantly adding items, I could create a function for this field that does the copying for me, and only when context parent is a parent of an item that has the "Test_Sort" value checked (In my case, the context parent is actually a grandparent).

  1. 4 manual steps to get good results (would your beloved Ecco do better?):

    1. Shift+Ctrl+1 to close all items
    2. Select all cells to renumber
    3. Edit > Renumber Items
    4. Re-Expand items
  2. If you add Item column at the end of the sort bar, your context parents will sort fine. Other items that have identical first level sort will sort too, but I can't see a single reason why this would be a problem

As always, it is terribly difficult for us to see any use to all these theorical situations without real practical examples. Ask yourself what other tool can provide even a fraction of what IQ can do for you

If you add Item column at the end of the sort bar, your context parents will sort fine. Other items that have identical first level sort will sort too, but I can't see a single reason why this would be a problem

 Of course! I put it first and that didn't work... Thanks!

As always, it is terribly difficult for us to see any use to all these theorical situations without real practical examples. Ask yourself what other tool can provide  even a fraction of what IQ can do for you

I am not criticizing at all!  I can't use any other program to do many of the things that I am now trying to do with IQ. I am just trying to learn how to do it. That is why I am asking for help (sorry for not grasping some things myself w/o asking). I hope that I will have a deep understanding of IQ within the next year 😉......

 

p.s. I am just trying to understand (no critique!): It doesn't appear to be possible to manually sort context parents by moving them around in the grid like I can do with regular items. Is that correct?

How do I ?