Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm trying to build an expression that does the following
I have my current year in a variable v_CurrentYear and my previous year in a variable v_PreviousYear. Could someone please help me along with my expression? I'm stuck with all the '$', '#', '{' and '('...
What are the other relevant fields? Do you have a year field?
If you have a year field, then:
Last Year:Sum({<Year={$(=v_CurrentYear)}>} Gross)
Sum({<Year={$(=v_CurrentYear-1)}>} Gross)
If your year field is a string, then you would need quotes. If you don't have a Year field, I would create one in the load, but the expression could be modified to be a between two dates.
To ignore a field, add it into the Set Analysis without an Element Set. For Date, it would be:
Sum({<Date=,Year={$(=v_CurrentYear)}>} Gross)
Year does not need to be ignored, because you are already modifying its value with the Set Analysis.
The problem with this expression is that it will return a Sum of ALL data from last year. I only want a SUM that returns me the data from last year starting from January 1st and then running to today's date MINUS one year.
So for today that would mean: 2010-01-01 till 2010-02-14
Then you need a modifier on date. Last year:
Sum({<Date={'<=$(=AddYears(Today(),-1))'},Year={$(=v_CurrentYear-1)}>} Gross)
You could also put two conditions on Date to define a span:
Sum({<Date={'>=$(=MakeDate(Year(Today())-1))<=$(=AddYears(Today(),-1))'}>} Gross)
Make your life easier. Take a look at
http://iqlik.wordpress.com/2011/01/01/point-in-time-reporting-out-of-the-box/
you can solve this problem?? i have the same issue.
Help please, i stuck with this since 2 weeks and i haven´t a solution
Thanks