Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
i need on selection of date from calender ( if i will select date as 12th dec 2015 to 13th dec 2017)then sales of 2015 should reflect under text box named prev_year(in blue) in charts and sales of curr_year(in blue) in chart.
so for that how to declare variable for calender and how to use it ?
From calendar object pass the date values to two variables and then use
=Sum({<Date ={">$(vFromDate) <=$(vToDate)"} >} Value)
Or
=Sum({<Date ={">$(=vFromDate) <=$(=vToDate)"} >} Value)
And with other SET expression also.
May be apply for Background color like, As always you are superb my dear ... Try to provide genuine business and explain more clear your intend ..!
If(DateField = Date($(Prev_Year),'DD-MMM-YYYY') and DateField = Date($(Curr_Year),'DD-MMM-YYYY'), Blue())
OR
If(DateField >= Date($(Prev_Year),'DD-MMM-YYYY') and DateField <= Date($(Curr_Year),'DD-MMM-YYYY'), Blue())
for prev_year i am using following expression now should i combine both of the?
=num(SUM({$<Sold_Date = {'>=$(=Addyears(YearStart(Today()),-12))<=$(=AddMonths(MonthEnd (Today()),-12))'}>}([inv value]))/Sales_INR_Unit,
'#,##0.0')
Check this tread
Date Range using Calendar Object | Qlik Community
The Basics about Dates, Date Ranges and Set Analysis
The expression that you shown is not requied here you have to add StartDate and end date variable in your expression.
SET v_STARTDATE = '01/01/2016';
SET v_ENDDATE = '31/12/2016';
TMP_DATE_1:
LOAD date(date#('$(v_STARTDATE)','DD/MM/YYYY')-1 + recno() ,'DD/MM/YYYY') as Date
AUTOGENERATE (date#('$(v_ENDDATE)','DD/MM/YYYY') - date#('$(v_STARTDATE)','DD/MM/YYYY')) + 1 ;
TMP_DATE_2:
LOAD
Date
RESIDENT TMP_DATE_1;
DROP TABLE TMP_DATE_1;
this is fine for this?