Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I've come across a function (??) called GetSelectCount in a script. What does it actually do ? The actual code is as follows:
=If(GetSelectCount($(SalesYear))=0,Year(Today()),MaxString($(SalesYear)))
What does it count ?
Thanks for your help
MV
Here SalesYear is a variable and gets expanded with dollar sign. It is expected to return a field name. Hence the getselectedcount($(SalesYear)) would return number of field values that are selected in that field.
Hi,
Getselectedcount() - Function returns the number values we are selecting in that Field.
In Your case,
If you are not selecting any year, it returns the Current Year,
If you are selecting one or more than one year, it returns maximum of the slected year.
Thanks,
Pradeep
GetSelectedCount(fieldname [, includeexcluded=false])
returns the number of selected values in the field named fieldname. If includeexcluded is stated as true, the count will include selected values which are excluded by selections in another field.
Examples:
getselectedcount( Customers )
getselectedcount( Customers, true )
Here SalesYear is a variable and gets expanded with dollar sign. It is expected to return a field name. Hence the getselectedcount($(SalesYear)) would return number of field values that are selected in that field.
OK...so are you saying if I select years 2010 and 2012 then the number of field values returned will be 2 ?
No,
if you will select 2010 and 2011, it will return you 2011, and if you will select 2011, 2012, 2013 it will return you 2013,
simply it will return you the maximum selected year, if nothing is selected than it will return you the maximum year from that listbox.
Goto variable overview window and see the definition of the variable. Then you would understand for which field the result is expected.
Ah thank you...it's the value of the field, not the 'number of field values' as tresesco suggested.
I understand it now.
Dear,
what I said was about getselectedcount() alone (that is exactly what you asked for in your question title) and not about the entire expression. However, it's a misunderstanding, good that you got your answer.
if you have got the answer ,than close the thread..