Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello all,
I am facing this problem:
I have the following table and the calendar on the left (myDay, myMonth, myYear). I would like to calculate the value spent per year (per customer). I only want the payment years which are equal to the selected year. In this case, only 2016 should appear, but all the payment years are appearing.
This is my table expression (value per year):
=sum({<myYear=, myMonth=, myDay=, myDate=,CustomerID={'*'}-{'-1'}, [Payment Year] = {'>=$(=date(min(myYear)))<=$(=date(max(myYear)))'}>}[Sum Per Year])
Any ideas on how to do this? Thanks in advance.
Cheers,
Inês
May be this:
=Sum({<myYear=, myMonth=, myDay=, myDate=,CustomerID={'*'}-{'-1'}, [Payment Year] = p(myYear)>}[Sum Per Year])
you need to use the year part of the date so why are you using Date(max(MyYear)))
what is My_Year? is it a date value or year as integer?
May be this:
=Sum({<myYear=, myMonth=, myDay=, myDate=,CustomerID={'*'}-{'-1'}, [Payment Year] = p(myYear)>}[Sum Per Year])
Unfortunately it doesn't work .
Hi,
I want to show only "Payment Year" that equals MyYear(selected year). Both of them are date fields.
Do you have a sample you can share?
Are myDate, myDay, myMonth and myYear associated with the transaction dates in your data?
Posting a view of your data model may help.
so you need to get the year of those dates
so use Year(Date(max(myYear)))
cause I assume that Payment Year is a year value not a date no?
Hi Ines,
it would be best if you could upload an example qvw, then we can see what's happening.
HTH
Andy
Hi all,
Unfortunately it was my fault, I had somehow defined an alternate state and it wasn't working because of that. Now it's done.
Thank you!