Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
In Which situation we will use only(),can any one explain with sample scenario.
regards,
Hi,
When there is one to one relation ship, we can use only function.
In simple word,
Table:
LOAD * Inline [
Dim1, Dim2, Value
A, India, 10
B, USA, 30
];
If we use Dim1 in textbox without any selection , it display null value for both
=Only(Dim1) or Dim1
If We select any value in Dim1, it display the Value in textbox.
If we need to use "Set Analysis", in that case we can use Only() function.
Only({<Dim2 = {'India'}>}Dim1) display A.
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.
Just created an example for Only() today. Have a look here: Only
Hi Koti,
Help description of Only:
only([{set_expression}][ distinct ] [ total [<fld {, fld}>]] expression)
If expression or field iterated over the chart dimension(s) contain one single value, that value is returned, else NULL is returned. Only can return numeric values as well as text values.
Examples:
only( Sales )
only( Price*Quantity )
only( total Salesman )
HTH- Andy
Still i am in confusion? what is the necessary of use only() in the above example..instead of that if i take dim2 in listbox..then that time also it's working fine..
Only() - although it appears to be an extremely straightforward function - is actually a very advanced aggregation function that will save your day more than once. If the use of Only() isn't apparent to you yet, don't worry. You do not need it. You have a solution but no corresponding problem, so just ignore it for the time being.
One of my preferred uses for Only() is whenever I need to apply set analysis on very few values to select a single one. Only() is the only function that let's you pick a single value from a range by simply using set analysis.
Peter