Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a text object that displays a value from a variable, but I only want this value to show if a selection is made in list box, otherwise I want it to show 0.
Basically, I have a list box called semester with 2 values, 1301, 1401. the text object is called "Selected Semester" and it should show the result of the following expression only when a value is selected and for that specific value.
Count(EMPLID)
What should I write in the variable definition?
then simply Count(EMPLID)
or in the definition of your variable write the following
=Count({<your_field={desired_value}>}EMPLID)>0
if this is not the case please elaborate more
Use the function GetSelectedCount(fieldName)
But that only gives me the number of selected fields. What I want to do is get the count of EMPLID where the semester is equal to the selected one from the list box.
then simply Count(EMPLID)
or in the definition of your variable write the following
=Count({<your_field={desired_value}>}EMPLID)>0
if this is not the case please elaborate more
The code you wrote looks like what I want, but if only i can replace the "desired_value" with the selected value of the listbox, like if I selected 1401 from the listbox, I want 1401 to fill in the place of the desired value. The main thing here is that I want it to show 0 when nothing is selected and only act when something is selected.
then replace desired_value with Concat(distinct field_name,',')
use the following to check if a desired value is selected:
if(index(concat(distinct your_field,','),'your_desired_value')>0 ,1,0)
='Selected Semester : '&IF(GetSelectedCount(semester)>0,Count(EMPID),0)