Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
This works
sum( {$<Year = {$(#=Only(Year)-1)}>} Sales )
based on selecting the Year
but this doesn't
sum( {$<Month = {$(#=Only(Month)-1)}>} Sales )
Is it possible to get this to work ie if I select the month of June it selects May etc
Thanks
Hi,
In your second expression, you need to change Year = by Month:
sum( {$<Month = {$(#=Only(Month)-1)}>} Sales )
Also, make sure that your month is a number.
This is not the best approach as when you select January the month will be 1 and 1-1 = 0.
Instead, you can create a sequential number for the month in your script like this:
Load
...
YEAR*12+Month as Sequential_Month
From...
I hope this helps.
JV
Hi,
depending on how your months are formatted, try sth like this
>> sum({$<Month = {month(monthstart(today(), -1))}>}Sales) <<
( >> monthstart(today(), -1) << will give you the first day of the past month and you can go from there)
HTH
Best regards,
DataNibbler
Try this...
sum( {$<Month = {$(#=Subfield('$(MonthNames)',';',Only(Month)-1))}>} Sales )
Thansk for your reply
I actually had
sum( {$<Month = {$(#=Only(Month)-1)}>} Sales )
but it does't work
Ive tried num in various places but it still doesn't work
Ive been working on variosu combinations for hours but maybe I need a rest
like
sum( {$<Month = {$(#= num (Only(Month))-1)}>} Sales )
and
sum( {$<Month = {$(#= Only (num (Month)))-1)}>} Sales )but nothing works
QV can be frustrating at times (like most system though)
Hi RJ,
Is your field Month actually a number?
Also, try to create the sequential field as mentioned. It will make things easier.
Thanks,
JV
No. I,ve used Jan Feb Mar etc
I know this is the problem (using Jna rather than 1 etc) but how do I convert Jan to a number
And thank for your assistance
MonthNames. Do I put in Jan,Feb, Mar as sub fields
In that case you won't be able to subtract a number from a string. Please create a numeric number for this.
JV
NO.. .just try it once