Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Parzival1969
Contributor
Contributor

Sorting a table with an invisible field

Hello,

 

even after research in these forums I am not sure what the best solution is.

A simple table has some fields. The underlying datatable has additional fields and I need to use one of the to sort the straigt table.

e.g. Name, Firstname, Adresse, etc.

Sorting should be done by a field "rank in organization" that should be visible on the sheet.

Please advice

Thanks

Niko

Labels (1)
7 Replies
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi Niko,

Have you tried sorting By Expression? That's how it's usually done. 

Cheers,

Parzival1969
Contributor
Contributor
Author

Hello Oleg,

I have a combined field [Kunden.ReportingSortierung] in the table Kunden. This field contains a sorting logic and is created in the load script. As long as this column is also visibile in the chart table it can be sorted by that column and everything is fine.

If I want to hide this column (because it does not contain relevant information for the user), it does not work any more. eg. I set the criteria for show column if 0=1 then the sorting is also gone.

Sorting for all other columns is disabled.

I hope that I simply don´t see the solution and cannot find the solution because I am using wrong search key words.

Input is very welcome.

Parzival1969_0-1676198151196.png

 

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

The sorting field doesn't have to be present (neither hidden nor visible) in your table chart. Select sorting for one of the visible fields, for example "Firma" and specify "Sorting by expression" (this option even appears on your screenshot) - check the checkbox and specify the sorting field in the expression formula. That should do the trick. If it doesn't work the way you expected, try using aggregation functions with your sorting field, like MaxString() for example.

Cheers,

Parzival1969
Contributor
Contributor
Author

Hello,

I can´t get this done.

1.Sort by expression - see screenshot below

2. MaxString([Kunden.ReportingSortierung]) - no change at all

It always seems that the sorting is done on the visible field FIRMA, because "Diverse" is shown before "AMM".

Is there any idea what I am doing wrong here? Sorting a straigth table should be quiet simple...

Thanks

Niko

 

 

Parzival1969_0-1676272006876.png

 

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi Niko,

It's quite hard for me to diagnose the problem without seeing a sample App. If you can post a sample, I wouldn't mind looking into it.

However, showing "Diverse" before "AMM" tells me that the data is NOT sorted alphabetically, so maybe you have you r solution, but you are not seeing it right?

Cheers,

Primrose
Contributor III
Contributor III

Hi Niko,

Why don't you try using WildMatch() to sort by expression? E.g. Wildmatch([Kunden.ReportingSortierung], 'value 1', 'value 2', 'value 3') ? You can then select if you want the sort order to be ascending or descending.

You may also would like to check this topic.

Regards,

Iggy

Parzival1969
Contributor
Contributor
Author

Hello Iggy,

I was looking into solution with WildMatch() as well. Currently every record has his own sorting field. Using WildMatch() I need to put all sorting field values into the WildMatch() function. It would run from value1 to value200 and would need to maintain the logic in the script as well.

Nevertheless I will follow this path.

After doing several years QV and now QS it feels very strange why this trivial thing does not work at all.

Niko