Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear All,
I've having trouble trying to get a Set condition working with a variable for about 5 hours already.
Wondering if someone can shed some light on what's wrong with the following
//sum({$<Year = {2013}>}[Value]) ** This works
//sum({$<Year = { $(=Max(Year)) } >} [Value]) ** This works
//sum (if (Year = $(thisYear), Value)) ** This works
//sum({$<Year = {$(=thisYear) } >} [Value]) //** This not so much !
//sum({$<Year = {$(thisYear) } >} [Value]) //** Nor this
I'm trying to just Sum the [Value] field for the current year.
The thisYear field is defined as follows
SET thisYear = Year(Now());
If I display thisYear in a text field it displays properly
I'm assuming the Set command is reading the literal "thisYear" rather than the value contained in "thisYear".
From my surfing around it looks right but it's obviously not or it would be working
Thanks for any assistance you can provide.
sum({$<Year = {"$(=$(thisYear))"}>} Value)
sum({$<Year = {$(=thisYear)}>} [Value]) This will work please check you have done anything else.
HI
Try like this
sum({$<Year = {"$(=thisYear)"}>} [Value])
Hope it helps
This was my first example above //** This not so much !
Just tried this
sum({$<Year = {"$(=thisYear)"} >} [Value]) //** Afraid not
Still not working.
Hi
Check thisYear getting today year or not??
Then use like above method.
Hope it helps
Doing things the 'old' way
sum (if (Year = $(thisYear), Value)) ** This works
thisYear does have the correct value.'
you can do it like this
sum({$<Year = { $(=Year(Now)) } >} [Value])
but what you were trying to do looks like a double dollar sign expansion, and you werent including the inner expansion.
Unfortunately still the same result ('No data to display')
sum({$<Year = {$(=Year(Now)) }>} [Value])
I had another attempt
Thinking maybe field name 'Value' was a reserved word, I changed it to QuantityField, same result.
This is the code I have in the Text Field which correctly returns 2013
= $(thisYear)
This code works in the 'old' way
sum (if (Year = $(thisYear), QuantityField)) //** This works
Looking for the 'Set' version of the same.
Could it be a 'Type' issue where the Year is string but the evaluation is numeric, or vice versa?