Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Sven2
Partner - Contributor
Partner - Contributor

Sorting values extracted with block "List Values Of Field"

Hi, 

I'm struggling to sort values that I extracted with the "List Values Of Field" block from my app. The values are in field qText.

I have right now: Orange, Banana, Apple, Strawberry

I would like to have: Apple, Banana, Orange, Strawberry

 

I'm using a "Transform List" block with the list function "Sort".
This is the input:
{ "list": [ { "qText": "Orange", "qNum": "NaN", "qElemNumber": 0, "qState": "O" }, { "qText": "Banana", "qNum": "NaN", "qElemNumber": 1, "qState": "O" }, { "qText": "Apple", "qNum": "NaN", "qElemNumber": 2, "qState": "O" }, { "qText": "Strawberry", "qNum": "NaN", "qElemNumber": 3, "qState": "O" } ] 

The output is this:

[ { "qText": [ { "qText": "Orange", "qNum": "NaN", "qElemNumber": 0, "qState": "O" }, { "qText": "Banana", "qNum": "NaN", "qElemNumber": 1, "qState": "O" }, { "qText": "Apple", "qNum": "NaN", "qElemNumber": 2, "qState": "O" }, { "qText": "Strawberry", "qNum": "NaN", "qElemNumber": 3, "qState": "O" } ] }, { "qText": [ { "qText": "Orange", "qNum": "NaN", "qElemNumber": 0, "qState": "O" }, { "qText": "Banana", "qNum": "NaN", "qElemNumber": 1, "qState": "O" }, { "qText": "Apple", "qNum": "NaN", "qElemNumber": 2, "qState": "O" }, { "qText": "Strawberry", "qNum": "NaN", "qElemNumber": 3, "qState": "O" } ] }, { "qText": [ { "qText": "Orange", "qNum": "NaN", "qElemNumber": 0, "qState": "O" }, { "qText": "Banana", "qNum": "NaN", "qElemNumber": 1, "qState": "O" }, { "qText": "Apple", "qNum": "NaN", "qElemNumber": 2, "qState": "O" }, { "qText": "Strawberry", "qNum": "NaN", "qElemNumber": 3, "qState": "O" } ] }, { "qText": [ { "qText": "Orange", "qNum": "NaN", "qElemNumber": 0, "qState": "O" }, { "qText": "Banana", "qNum": "NaN", "qElemNumber": 1, "qState": "O" }, { "qText": "Apple", "qNum": "NaN", "qElemNumber": 2, "qState": "O" }, { "qText": "Strawberry", "qNum": "NaN", "qElemNumber": 3, "qState": "O" } ] } ]

 

What settings should I use?  or is there a better way to do this?

 

Thanks for any help! 

Labels (2)
1 Solution

Accepted Solutions
Shai_E
Support
Support

Hi @Sven2 ,

I will send you a workspace example of a working example that i created.

Best Regards

View solution in original post

2 Replies
Shai_E
Support
Support

Hi @Sven2 ,

I will send you a workspace example of a working example that i created.

Best Regards

Sven2
Partner - Contributor
Partner - Contributor
Author

Thank you @Shai_E!

Your example made me realize that I must have encountered a bug in the Automation editor as I didn't see the selection list that asks if I want the first item, all items or the last item from the "List Values of Field" block. 

Today I see this and it works as expected.

 

Best,

Sven