Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

what is only() function how it works?

what is only() function how it works?please give one example friends.

5 Replies
Anonymous
Not applicable
Author

check this thread i think its helpful Use of ONLY Function

Not applicable
Author

Lke You want to see the sales of selected year, selected-1 year and selected+1.

For example i selected 2006 , so i want to see sales for 2006,2005 and 2007.

In this scenario , we can use only() function-

here is the script :

Sum({<Year={$(=Only(Year))}>}Sales) - 2006

Sum({<Year={$(=Only(Year)-1)}>}Sales)-2005

Sum({<Year={$(=Only(Year)+1)}>}Sales)-2007

ajsjoshua
Specialist
Specialist

Hi,

It returns only one  value or null incase multiple value returned.

ex:

country        city

india           Mumbai

India          chennai

india          delhi

only(country) means answer is india

only(city) means null.

Regards,

JOshua.

Chanty4u
MVP
MVP

hi,

did u chk dis?

How to use - Only()




When in dimension(column) all values are

the same ,Only will return this value:

                                        (otherwise NULL)