Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Only() function in qlikview - what is the use?

I am confused with only() function in qlikview while using in chart expression.

table i m using

ex:

LOAD * INLINE [

    sno, no

    1, 20

    2, 578

    3, 344

    4, 54

    5, 34

    6, 34

    7, 34

    8, 34

    8, 34

];

and in dimension i put the column sno and in expression i use "no"

and also try with only(no1).


chart is showing the same result.


what is the correct scenario  to understand "only()" function in qlikview.

ans what is the use of only() function in qlikview

Untitled.jpg

1 Solution

Accepted Solutions
tresesco
MVP
MVP

This discussion should be helpful: Re: Use of ONLY Function

View solution in original post

5 Replies
amit_saini
Master III
Master III

Gurjeet,

Please follow attachment.

Thanks,

AS

ashfaq_haseeb
Champion III
Champion III

HI,

with Only() you can add aggregation.

Basically its an aggregate function.

Edit:

from QlikView help

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.

Example:

Load Month, only(Price) as OnlyPriceSoldFor from abc.csv group by Month;

Regards

ASHFAQ

evan_kurowski
Specialist
Specialist

It is an aggregation function like Sum()

If all the rows in the aggregation sample have the identical value, Only() will return that value, otherwise it returns null.

In your chart each [sno] dimension evaluates to a single value for the field [no], once you add a row to your dataset upon which there are multiple possible [no] values for a single [sno], that evaluation of Only(no) will return null.

tresesco
MVP
MVP

This discussion should be helpful: Re: Use of ONLY Function

Not applicable
Author

thanks guys

all comments & links of urs are very helpful