Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Use of variables in Set Analysis

I feel I'm missing something very obvious here. Can someone please tell me the difference between these two expressions?

This expression returns data:

Count({<MATTER.MATTER_OPEN_YEAR={'2014'}>} MATTER.CLNT_MATT_CODE)

This expression does not. The currentYear variable contains the value '2014', which I have confirmed by displaying the contents in a text box. The expression editor shows no errors.

Count({<MATTER.MATTER_OPEN_YEAR={$(currentYear)}>} MATTER.CLNT_MATT_CODE)

Many thanks, Gavin

1 Solution

Accepted Solutions
Not applicable
Author

well, I would use the equal sign + double quotes. Sth like (but not tested):

Count({<MATTER.MATTER_OPEN_YEAR={“= $(currentYear)”}>} MATTER.CLNT_MATT_CODE)

Fabrice

View solution in original post

14 Replies
santharubban
Creator III

Hi Gavin,

Try this

Count({<MATTER.MATTER_OPEN_YEAR={"$(currentYear)"}>} MATTER.CLNT_MATT_CODE)

alexandros17
Partner - Champion III

At first verify with a text object that your variable really contains the correct value, then is so, try

Count({<MATTER.MATTER_OPEN_YEAR={'$(currentYear)'}>} MATTER.CLNT_MATT_CODE)

Just add ' because expressions are equal

Hope this is helpfull

Alexandros

Not applicable
Author

Thank you both for the answers. Unfortunately no luck.

I have verified via text box that the variable contains '2014'. (That variable was itself derived from another variable using Left(currentPeriod, 4), where the currentPeriod is '201410'...so there isn't much scope for error...).

Not applicable
Author

Hey Gavin,

Please check out the attached file. Hope it helps. I created a variable and used it in the Set Analysis similar to what you are doing.

Thanks

AJ

Not applicable
Author

Gavin,

OK your variable contains 2014.

But did you add the quotes ? if the basic syntax, without any variable is '2014' you must do '$(variable)' => put quotes

Fabrice

Anonymous
Not applicable
Author

Gavin,

Can you upload your application?  As Ajay Prabhakaran examples shows, you can use variable without quotes, and it works also with single and with double quotes.  The problem is somewhere else...  Maybe you misspell the variable?  It is case sensitive.

Regards,

Michael

Not applicable
Author

Thank you Ajay - That looks like an accurate representation of what I'm trying to do...but my file seems to behave differently. My QV file is too large to attach, but I will attach screenshots to a later post below.

Gavin

Not applicable
Author

Hi Aunez - I have tried adding quotes but have the same problem, i.e.

This works: Count({<MATTER.MATTER_OPEN_YEAR={'2014'}>} MATTER.CLNT_MATT_CODE)

This does not: Count({<MATTER.MATTER_OPEN_YEAR={'$(currentYear)'}>} MATTER.CLNT_MATT_CODE)

Thanks, Gavin

alexandros17
Partner - Champion III

Can you try this:

Add a new expression and write : if($(currentYear)=2014, 'Y', 'N')

Let me know what returns this expression

I expect Y....