Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
deepakqlikview_123
Specialist
Specialist

what is exact diffence between only() and aggr()

Hello Experts,

Can you please tell me what is exact difference between only() and aggr().

Thanks

5 Replies
alexandros17
Partner - Champion III
Partner - Champion III

ONLY:

If expression over a number of records, as defined by a group by clause, contains only one numeric value, that value is returned. Else, NULL is returned.

AGGR:

Returns a set of values of expression calculated over dimensions.

amit_saini
Master III
Master III

Deepak,

Check this:

Use of ONLY Function

Thanks,
AS

lironbaram
Partner - Master III
Partner - Master III

hi

only returns a value only if there is one distinct value in the filed we check

example :

only(EmployeeName) will return a value only if in the field EmployeeName will have 1 value

aggr returns a set of result according to the dimensions we defined in the function

aggr(if(sum(sales)>100,EmplyoeeName),EmployeeName)

will return a list of all emplyoees where thier sales are more than 100

swuehl
MVP
MVP

Well, I don't think the two functions have much in common, so maybe it's easier if you tell what you think they share?

hic
Former Employee
Former Employee

Only() is an aggregation function.

Aggr() is not an aggregation function.

http://community.qlik.com/blogs/qlikviewdesignblog/2014/05/19/function-classes

HIC