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

Any ideas on how to sort a straight table chart in the order the main dimension members were selected?

Hi all,

I may be missing something but I cannot see how to order a straight table chart , say by PartNo, in the order those PartNos were selected. I am using a brilliant macro written by some unknown person to allow pasting of a list of PartNos into an input box for selection and would like to output in the list order.

TIA,

Jane

1 Solution

Accepted Solutions
Not applicable
Author

I have a solution, but it isn't simple or very pretty. I think it should work for your situation.

I created a macro that would take the Part No entry (which I'm assuming is set to a variable) and parses through that entered list to create a sort expression, which is stored as a different variable. The sort expression on the chart is then set to the sorting variable using a dollar sign expansion.

I have posted a sample which using simplified data. I didn't bother with any selection, because you said you had that working. I believe you should be able to set this macro to be triggered for the OnSelection event of your Part No field, which should be triggered by your other macro making the selection on that field. Once this macro runs, your chart will be automatically sorted.

View solution in original post

3 Replies
Not applicable
Author

I have a solution, but it isn't simple or very pretty. I think it should work for your situation.

I created a macro that would take the Part No entry (which I'm assuming is set to a variable) and parses through that entered list to create a sort expression, which is stored as a different variable. The sort expression on the chart is then set to the sorting variable using a dollar sign expansion.

I have posted a sample which using simplified data. I didn't bother with any selection, because you said you had that working. I believe you should be able to set this macro to be triggered for the OnSelection event of your Part No field, which should be triggered by your other macro making the selection on that field. Once this macro runs, your chart will be automatically sorted.

Not applicable
Author

Thanks I will give this a whirl.

Not applicable
Author

Thanks for the solution worked. I had to add some filters to get rid of single quotes thoug. Is there a prize for the longest expression in QlikView BTW?

Wink