Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to compare records of the currently selected year and 2 years of its past?
For example, if I currently select 1998 as the year it should compare 1996 year's subtotal with the 1998 year's subtotal, in bar chart
=sum({$<OrderYear=getfieldselections(OrderYear)-2>}Subtotal)
I'm getting the desired result, with the above statement.Can you help me the above statement and correct if it has some mistake.Thanks in advance
Hi,
use this instead:
=sum({$<OrderYear={$(=getfieldselections(OrderYear)-2)} >} Subtotal)
Or
=sum({$<OrderYear={$(=Max(OrderYear)-2)} >} Subtotal) ==> to always have a result displayed even if you select nothing on the OrderYear
hope it helps
Hi,
try this way,
sum( {$<OrderYear={"$(=max(OrderYear)-2)"}>} Sales)
Hi Baarathi,
Your above statement is correct if you want on another way like below:
=sum({$<OrderYear={'(=AddYears(max([OrderYear]),-2))'}>}Subtotal)
Thanks,
Arvind Patil
Thanks a lot sir for the solution,But this expression "$(=max(OrderYear)-2)"given within double quotes,can you explain me this part?
Thanks a lot sir.Can you explain this part '(=AddYears(max([OrderYear]),-2))' the contents given within single quotes will be treated as values right? can you please explain this part of your statement alone?
Thanks a lot sir.
Hi,
Single/double defined like this way
String value : Required single quotes within the element set
numeric value : do not require single or double quotes
expression or search : require double quotes
for more details check here,
Hi Bhaarthi,
1. AddYears function add number of years into your current date so if you add negative years (-2) so it minus from current date.
2. Single quotes treated as value.
Please add below code into text box you will get idea:
=AddYears(Max(Today()),-2)
Thanks,
Arvind Patil
Thank your sir.It was very much helpful