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

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

What does 'Get SelectedCount' actually do ?


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

Labels (1)
14 Replies
Not applicable
Author

Why do you think SalesYear is a variable ? It's a field name.

You've completely confused me again !

Can someone tell me.....does GetSelectedCount return a count or a value ?

Not applicable
Author

Well, I haven't got the answer.

You are saying GetSelectedCount returns a value, whereas Tresesco is saying GetSelectedCount returns the number of field values selected. These are two different things and I'm still none the wiser.

Help !

israrkhan
Specialist II
Specialist II

Yes, Tresesco said right...

GetSelectedCount Return the "Number of  Selected values" .

let say, if you are writing this expression in text object =GetSelectedCount(Year), and you have selected year 2011 and 2012, in this case ,it will return you "number of selected values in year field" and you will see "2" in the text box.

but what i tried to explain you ,that is use of GetSelectedCount in your expression, which is

=If(GetSelectCount($(SalesYear))=0,Year(Today()),MaxString($(SalesYear))),

here in the expression , GetSelectedCount will return result to your IF statement, and than if statement will return the final result that will be displayed in your object, that result will be Maximum Year.

so you need to understand if statement as well..

hope it help...

tresB
Champion III
Champion III

See the attached qvw to come out of confusion.

Not applicable
Author

Right. I think there was a misunderstanding of language here. I became confused when you said, "No" !

Thank you to Tresesco for the correct solution to the original enquiry.

And thank you for explaining the meaning of the full script statement which includes the MaxString function.