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????????
its giving an error
syntax error
What you've done? Can you share image?
Let Prev_Year = AddYears('2017-10-12',-2);
when i am using this in variable
What you shown is working?
now yo want me to use these variables instead of these?
Let currentdate =DATE(Today(1)-1,'YYYYMMDD');
Let Curr_Year = Year(Today());
Let Prev_Year = (Year(Today())-1);
variable used in text box is working but charts are not showing results, it can be seen in image
Yes? You can play with that your needed. Because, Still 100's reply are not helpful if thread owner not explaining clear and needed
actually i dont want entire date. i only want year to like instead of 10/12/2015. i want only 2015
How come i know what expression you attempt?
What we try everything available from Qlikview Cookbook | Recipes for Qlikview Success