
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- « Previous Replies
-
- 1
- 2
- Next Replies »
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Gavin,
Try this
Count({<MATTER.MATTER_OPEN_YEAR={"$(currentYear)"}>} MATTER.CLNT_MATT_CODE)


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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...).

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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....

- « Previous Replies
-
- 1
- 2
- Next Replies »