Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Macro for sorting a chart

Hi,

I have some difficulties to sort a chart by an Expression. I want to sort the chart by Spends DESCENDING (Numeric Value: Descending). But I want to do this within a macro script, for a button action. And I don't know how exactly to do.

Can you give me some help regarding this, please ?

For example my chart has ID = 'CH01' and my expression is 'SpendEuro'.

Thank you,

Claudiu

5 Replies
MayilVahanan

Hi

Try like this

Sorting Macro | Qlik Community

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
marcus_sommer

If your sorting didn't work within the gui like you expected it you couldn't get it with a macro which could only apply the same methods and logics like within the object itself. Therefore you need to adjust your sort-expression and I think the reason why it didn't work is you didn't use an aggregation. You need something like: sum(SpendEuro).

- Marcus

Chanty4u
MVP
MVP

Not applicable
Author

Is working using GUI but my chart is always 'generated' by a macro and is not keeping the GUI settings .

marcus_sommer

Yes, then have a look on the suggestion from Mayil whereby there are also possibilities for this without macros, like: User Controlled Charts In QlikView then (could be) Macros are Bad.

- Marcus