Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

What is the syntax to sort a column ascending?

Hi All,

I have what I hope is a pretty simple question. I am writing a macro to export a table for a report and I need to first sort a column ascending. I also have to then input <101 to get the top one hundred. What is the syntax so I can make these selections before I export it into excel?

Thanks,

Austin

3 Replies
Not applicable
Author

Hello Austin,

We use something like this within the script

Load A,B*C as E resident tab1 order by C desc, B asc, 1 desc;

But not sure if this is of any use to you... or could be around this...

Mama

Not applicable
Author

I am not sure I follow your suggestion. I don't want to make these selections in the load script if that is what you are referring to. I want to make the selections right to the table. I want to do this because I have to filter several columns in this same manner and export each table seperately. Currently it is a manual process where I set these filters and then export the table, and I am just trying to write a macro that does it for me.

Not applicable
Author

I was able to fix the sorting of the column ascending with a very easy solution. ActiveDocument.GetSheetObject("Table").Sortby 4. With 4 being the column number in the table. However, I still haven't been able to fix the search input.

Austin