Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All
I want to show dynamic header name changing for example ='country =' & country, if i select single country it will show country name on caption but if i select more than one selection on country it did not show on caption and what is difference between ='country =' & country and ='country =' & only(country) please let me know solution for this requirement
Thanks in Advance
Nihhal
Hi
try
='Country = ' & GetFieldSelections(country)
Thank you Alexis, what is difference between ='country =' & country and ='country =' & only(country), do you have any idea
Hi Nihhal L,
Would the following help you?
=concat(Country, ' , ')
What it does is, it lists possible Countries and avoids duplication of it while separating them with a comma.
Let us know how it goes.
Best wishes,
Sorry Kadir i could not understand please let me know what exactly doing only () here
In this case, no difference is there. Only() function returns a NULL if not single value is selected(in other words, it can return a value if the scope is limited to a single value). If you use the field name alone, then qv treats it as Only(fiel name) internally.
only() function means it will return a single value at a time. of course it will still depend on function combination
example:
if you have country with data as A,B, C, D
aggr(only({<country = {'A','B'}>}country),country) //this will return country A and B
while only(country) // this will return a single country (whichever you selected) at a time.
so on your question with
=country vs =only(country)
=country //will list all possible country when used as dimension
while =only(country) //will list a single country when used as dimension.
Hi there
try this
='Country = ' & if(LEN(Country)>0,MaxString(Country),'All Countries')
BY DEFAULT IT SHOWS ALL COUNTRIES, WHEN U SELECT COUNTRY IT SHOW PARTICULAR COUNTRY
REGARDS
PREMHAS
Hi NIhhal,
When you use Only() function, it will return only one selection from the particular field.
Your requirement is, to display no.of selected items in the field 'Country'.
Option:1
=GetCurrentSelections(Country)
Will display Name of the Field and the values from that field. (One or More)
But it will display NULL, when no selection were made.
Option:2
='Country :'&GetFieldSelections(Country)
This will return the selected items from the field (One or More).
As the expression contains 'Country : '& will display all the time (when no selection is made, will return name Country).
I welcome all your comments and feedback.
Regards,
Pavan Kumar.
Hi NIhhal,
what exactly doing only () here?
Only() function will only return selected item from a particular field.
If no selection were made, then nothing to display.
When you are trying to use Only(Country).
It will display only one selected item from country field, if you select more that one item or no selection were made, there is nothing to display.
Hope you got the solution.
I welcome all your comments and feedback.
Regards,
Pavan Kumar.