Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Experts,
I have a query regarding only() function. Can we use it in script level or UI level.I have used it in Script level but not getting exact syntax . I have searched in many places but I have not got clarity.
Can you make it out in attached file where I mocked some data in excel and attached. The mocked data might not correct. Can you make it out .
Thanks a lot.
It works but probably it is not what you want ...
The function Only returns Null if there are more values for the field grouped (month in your case) so it return null because you have more than une distinct value for each month, otherwise only returns the single value.
Hope it helps
Hi, I am not sure what is your requirement. The Only is used in below senerio in the script:
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.
As per your data in Excel, you get the null values in the Sales Per Month.
Hi,
Can you update the excel sheet so that it will give any value from that function. Please send me the updated excel sheet . I just want to understand the usage of only() function.
Here it is
Many thanks for your quick response.
I can use sum(distinct sales) for this requirement also which also give same results. You mean to say only function will be used to get the distinct numeric records from group of records
Which is similar with sum(distinct sales) . Do let me know plz.
... more or less ... I use "Only" when i WANT only a value to be retrieved.