Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm trying to use the following expression, but it doesn't work:
sum({<MY_YEAR={$(=Only(year(today())-1))}, MY_MONTH= {"<= 11 "}>} MY_VALUE )
My aim is to calculate the sum of purchase, regarding the previous year and till november
Help please !!
Thanks in advance
Hi
=month(today()) does not return 11 it returns nov.
Try:
Num(month(today()))
Dennis.
You might cope with at least two pitfalls here:
- If user can select in any calendar field other than MY_YEAR and MY_MONTH, you need to explicitely clear these fields to avoid inconsistent selection state.
sum({<MY_YEAR={$(=Only(year(today())-1))}, MY_MONTH= {"<= 11 "}, MY_DATE= >} MY_VALUE | ) |
- If MY_MONTH is not numeric only, but a dual, you might need to compare the text value in the set modifier (i.e. try using a numeric Month field).
I usually don't use year and month for set modification, but a Date field, then clear all other fields.
Hope this helps,
Stefan
I'm sorry but I didn't catch what you mean.
I've to build two different expressions:
in the first case, the purchase amount for the whole 2011
in the secon case the pruchase amount till current month
So in the first case MY_YEAR is a DB field and MY_MONTH is needless
In the second expression, MY_YEAR is still a DB FIELD and MY_MONTH is the result of year(tiday())
I'm sorry but I'm really confused
Stefan
It's up to me to be a little confused 😉
So in the first case MY_YEAR is a DB field and MY_MONTH is needless
In the second expression, MY_YEAR is still a DB FIELD and MY_MONTH is the result of year(tiday())
MY_MONTH is the result of year(today()) ? It's not a field in the data model describing a month?
I'm sorry, I made a mistake. MY_MONTH is a DB field and represent the purchase_month.
For the current year, I've to sum all the purchase values, till the current month (month(today())
Hi
=month(today()) does not return 11 it returns nov.
Try:
Num(month(today()))
Dennis.
Thanks very much!!
Stefan