Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I want to compare two years sale ie the current year should be the 2017 and prev year should be either 2016,2015 or any other year less that 2017
so in my script i have declared my variable as :-
Let currentdate =DATE(Today(1)-1,'YYYYMMDD');
Let Curr_Year = Year(Today());
let prev_year=..............
createdate is a column in database
Date#(CreateDate, 'YYYYMMDD') as Sold_Date,
month(Date#(CreateDate, 'YYYYMMDD')) as Sold_Month,
year(Date#(CreateDate, 'YYYYMMDD')) as Sold_Year,
in my expression i have expression for prev_year and curr_year
curr_year expression:-
=num(
sum(if(Sold_Date <= MakeDate(Curr_Year,month(To),day(To)) and Sold_Date >= MakeDate(Curr_Year,month(From),day(From)), [inv value]))/Sales_INR_Unit,
'#,##0.0')
for prev_year
=num(
sum(if(Sold_Date <= MakeDate(Prev_Year,month(To),day(To)) and Sold_Date >= MakeDate(Prev_Year,month(From),day(From)), [inv value]))/Sales_INR_Unit,
'#,##0.0')
Now what all changes are required for prev_year expressions? and for prev_year variable declration????????
i have already mentioned above
for 2016
=num(
sum(if(Sold_Date <= MakeDate(Prev_Year,month(To),day(To)) and Sold_Date >= MakeDate(Prev_Year,month(From),day(From)), [inv value]))/Sales_INR_Unit,
'#,##0.0')
Prev_Year
Let Prev_Year = AddYears(10/12/2017,-2); so its giving result as 10/12/10 but i want to show only 2015 in text box
and chart should also show appropriate results
I even stated same with first reply. Try a shot
Let Prev_Year = Year(Today())-2; // this will return 2015
this i was doing but now i want that when i will select date in calender as 20/12/2016 , the text box should show year as 2016 and the corresponding sales in chart
how to declare variable in such case?
I already suggest the link which CookBook. From there you will get everything. Anyway
First try plane instead of Variable for now
You have calendar that means field name or Calendar object.
Calendar object - Means you have done using Variable/ Simple Field
And finally, Try AddYears(Year(Max(FieldName)), -2) OR Year(Max(FieldName))-2
i have used variable
min(sold_date)secondly if i have to use it plain not as variable then how to use?
i mean simply ishould write in script or expression instead of prev_year variable?
When i say Plane - It should be Text object
So, To demonstrate your issue you could use From Variable instead of using FieldName.
If none of them not working. Please share some Mock up test (I apologies) for asking...
Not sure, Issue got resolved? If so, I would recommend you to do your Job (Please close this thread)
When i say, Close this thread means, You have to mark proper answer as "Correct Answer" using Flag..