Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
Not applicable

Different outputs for macro sorting

Hello,

I have a dynamic chart which created based on a macro script. And in that macro I have a sorting method for a specific column.

Sub SortChart 

  Set ch = ActiveDocument.GetSheetObject("ADHOC") 

  ch.SortBy 4

  

  Set p = ch.GetProperties 

  Set dims = p.Dimensions 

 

  i = dims.Item(0).SortCriteria.SortByNumeric 

  If i = 1 Then 

  dims.Item(0).SortCriteria.SortByNumeric = -1 

  Else 

  dims.Item(0).SortCriteria.SortByNumeric = 0 

  End If 

  ch.SetProperties p 

End Sub 

The weird thing is that in the Qlikview Application is sorting well, I have the desired output. Is sorting descending based on desired column.

But when I access the application from the web (linked to a server). Is sorting the chart ascending. I've tried to invert the 'SortChart' macro but nothing.

Do you have any idea why this is happening ?

Thank you!

1 Solution

Accepted Solutions
Highlighted
MVP & Luminary
MVP & Luminary

Re: Different outputs for macro sorting

If possible you should avoid macros within the gui  and there are different alternatives for creating User Controlled Charts In QlikView.

- Marcus

View solution in original post

10 Replies
Highlighted
MVP & Luminary
MVP & Luminary

Re: Different outputs for macro sorting

The macro itself is running and only the sorting didn't work?

- Marcus

Highlighted
Not applicable

Re: Different outputs for macro sorting

Yes, the macro is running. The sorting is working well in the qlikview application. But on web is reversed. I want to sort Descending, but on web is sorting Ascending.

Highlighted
MVP & Luminary
MVP & Luminary

Re: Different outputs for macro sorting

With web you mean the IE plugin? Which releases from desktop client, server and plugin do you use?

- Marcus

Highlighted
Not applicable

Re: Different outputs for macro sorting

The application is on a qlikview server, linked to a domain (website). I'm using a ticketing url in order to link the qv application. And the browser I'm using is Chrome.

Highlighted
MVP & Luminary
MVP & Luminary

Re: Different outputs for macro sorting

Chrome meant you are using the ajax-client and the most macros won't run in them.

- Marcus

Highlighted
MVP & Luminary
MVP & Luminary

Re: Different outputs for macro sorting

Why are you using a macro at all? You could sort by expression for example and use a variable to specify if you want to sort in ascending or descending order. Or use the same dimension twice, once sorted ascending and once sorted descending, and then show/hide one column based again on the value a variable that the users sets with for example a button or text object.


talk is cheap, supply exceeds demand
Highlighted
Not applicable

Re: Different outputs for macro sorting

Is the same thing in Internet Explorer too.

Highlighted
Not applicable

Re: Different outputs for macro sorting

Thank you for the answer. But I'm working on a already developed application, and the chart is dynamical created each time when you press some buttons. And I have to find a workaround.

Highlighted
MVP & Luminary
MVP & Luminary

Re: Different outputs for macro sorting

If possible you should avoid macros within the gui  and there are different alternatives for creating User Controlled Charts In QlikView.

- Marcus

View solution in original post