Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
Not applicable

Can we use group by and order by clause directly used in script?

Hi Friends,

Please help me.

Thanks&Regards

Ramesh

3 Replies
mjayachandran
Contributor II

Re: Can we use group by and order by clause directly used in script?

Yes we can, see the examples below from Qlikview Help:

group by is a clause used for defining over which fields the data should be aggregated (grouped). The aggregation fields should be included in some way in the expressions loaded. No other fields than the aggregation fields may be used outside aggregation functions in the loaded expressions.

groupbyfieldlist ::= (fieldname { ,fieldname } )

order by is a clause used for sorting the records of a resident table before they are processed by the load statement. The resident table can be sorted by one or more fields in ascending or descending order. The sorting is made primarily by numeric value and secondarily by national ASCII value. This clause may only be used when the data source is a resident table. The ordering fields specify which fields the resident table is sorted by. The field can be specified by its name or by its number in the resident table (the first field is number 1).

orderbyfieldlist ::= fieldname [ sortorder ] { , fieldname [ sortorder ] }

Grouping data

Load ArtNo, round(Sum(TransAmount),0.05) as ArtNoTotal from table.csv group by ArtNo;

Load Week, ArtNo, round(Avg(TransAmount),0.05) as WeekArtNoAverages from table.csv group by Week, ArtNo;

Not applicable

Re: Can we use group by and order by clause directly used in script?

Thanks

mjayachandran
Contributor II

Re: Can we use group by and order by clause directly used in script?

You are welcome.

Please close this thread as answered if I have answered ur question.