Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
can you explain group by function in qlikview. since i'm beginner
with example data of two fields grouped
Hi Manoranjan,
if you do a search on the community, you will find this question has been asked and answered a number of times
you'll also find the QV reference manual has an explanation of this too
hope that helps
Joe
Hi,
directly from help!
group by is a clause used for aggregating (group) several records into one. Within one group, for a certain field, all the records must either have the same value, or the field can only be used from within an expression, e.g. as a sum or an average. The expression based on one or several fields is defined in the expression of the field symbol.
HTH
André Gomes
If you are referring to GROUP BY function from Load statement
Add this into Edit Script window and Reload:
Table1:
Load * inline
[
UID,ID,NULLCOLUMN,DATE,DATE-1workday
1,1,a,11-12-2013,10-12-2013
2,1,,15-11-2013,14-11-2013
3,1,b,07-10-2014,06-10-2014
4,2,,23-11-2012,21-11-2012
5,2,0,07-07-2012,06-07-2012
6,3,0,14-01-2015,13-01-2015
7,4,0,30-08-2014,27-08-2014
8,4,0,15-05-2013,14-05-2013
];
Table2:
Load
ID as ID2, count(UID) as IID
resident Table1
GROUP BY ID,UID
Hi,
The GROUP BY statement is used in conjunction with the aggregate functions to group the Data by one or more columns.
Ex:
Load
A,
Sum(B) as B,
Max(Date) as Date,
D on
From Table
Group by A,D;
Fields used in aggregations should not be used in same statement again else users will get invalid expression You must not include fields aggregate in group by.
Try to avoid fields in load statement which are not included in group by
Regards
Neetha
Understood and practiced with example data.
thanks all
Kindly mark Answer or helpful