Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Highlighted
Not applicable

Sort by Expression

Hi All,

How do I associate Sort Orders => Sort by Expression to a particular field in a group using a macro.

Thanks in advance

1 Solution

Accepted Solutions
Not applicable

Re: Sort by Expression

Hi Miller,

Thanks for your reply. I found a way to achive this.

groups = ActiveDocument.GetGroups

set gp = groups(0).GetProperties

set sc = gp.SortCriterias

sc(0).SortByExpression = 1

sc(0).Expression.v = "sum(Amount)"

groups(0).SetProperties gp

2 Replies
Not applicable

Re: Sort by Expression

set fld=ActiveDocument.GetField("Salesman")

set fldsrt = fld.GetDefaultSortCriteria

fldsrt.SortByExpression = 1

fldsrt.Expression.v = "sum(Amount)"

fld.SetDefaultSortCriteria fldsrt

Not applicable

Re: Sort by Expression

Hi Miller,

Thanks for your reply. I found a way to achive this.

groups = ActiveDocument.GetGroups

set gp = groups(0).GetProperties

set sc = gp.SortCriterias

sc(0).SortByExpression = 1

sc(0).Expression.v = "sum(Amount)"

groups(0).SetProperties gp

Community Browser