Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have 2 variables vCurrentYear & vPreviousYear
vCurrentYear = right (year(today()),2)
because I only want it to get '14'
vPreviousYear =$(vCurrentYear)-1
which will give me 13
Now, I want to create a new variable that will check a part of a field to see if its the current year or the previous year
I have a semester field which is filled like 1401, 1402, 1301, 1302
the 14 and 13 being the year.
now what I put into the variable was this
Count( {<(Left(Semester,2))=($vPreviousYear)>}EMPLID)
meaning count all the EMPLID where the first two digits of the semester field are equal to the Previous year which 13.
It won't work, I think it has to do with the syntax, some help please.
You can also keep your variables as you declared them initially and try the below:
count({<Semester={"=Left(Semester, 2) = $(vPreviousYear)"}>} EMPLID)
That's a tricky one. For now I found a small workaround modifying the vPreviousYear variable to 14*, 13* respectively.
13* in the set modifier does the same like using the left() function on the field (Which is not possible).
See attached.
I noticed a missing backet.
Count( {<(Left(Semester,2))=($(vPreviousYear)>}EMPLID)
I have not checked anything else though.
I must've missed it after trying to mix things up,
Count( {<(Left(Semester,2))=($(vPreviousYear)>}EMPLID)
Eventually, written like this, I get a red line just under the bracket in bold.
You can also keep your variables as you declared them initially and try the below:
count({<Semester={"=Left(Semester, 2) = $(vPreviousYear)"}>} EMPLID)
Learned something new
Martin,
Here's a link for another example of how to use this kind of search strings:
http://www.naturalsynergies.com/q-tip-5-show-top-performers-common-but-not-too-trivial/