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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
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

Labels (1)
5 Replies
MayilVahanan
MVP
MVP

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
MVP
MVP

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
MVP
MVP

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