Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 sakshikaul
		
			sakshikaul
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi
I have a variable named daysOfComparison declared as follows:-
=date(lastDate)-compday
where compday is the value entered by user for comparing no. of days.
Lets say if user enters 5 as comparison no. of days input box then the sales for 10/5/2018 will be displayed in chart as per formula mentioned above in variable
Note last date is 10/10/2018
Following is the image for above explanation

Now I want to write an expression for the same ie when user selects comparison(no. of days )=5 then sales for 10/5/2018 should be displayed
How to write an expression?
 sakshikaul
		
			sakshikaul
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		if I am entering compday as 7 then I am getting value as 10/7/2017
 sakshikaul
		
			sakshikaul
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		here both the expression are giving me same values
=Sum({<sold_Date = {"=$(=Date(date(Sold_Date)))"}>} [inv value])
 
and 
=Sum({<Sold_Date = {"=$(=Date(date(Sold_Date) - $(compday)))"}>} [inv value])
why?
Try this?
Sum({<sold_Date = {"=$(=Date(Max(sold_Date) - $(compday)))"}>} [inv value])
 sakshikaul
		
			sakshikaul
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		I want the variable which I am using here below in the image ie DaysOfcomp should be used in expression
so my expression will be this? This below expression is giving an error, Please help me in correcting this. Rest is done
=Sum({<lastDate = {=Date(DaysOfComp)}>} [inv value])
 
You said that DaysofComp is number which comes thru input box, And you are using Date format for that. Qlik can't identify as DD or MM or YYYY. Not really sure what you mean to first message and Different than Last Message. BTW, You expression Wrong - Check the set analysis rules here https://www.analyticsvidhya.com/blog/2014/01/set-analysis-qlikview/
And More over, You need to convert input box to Date then my suggestion would be this - https://help.qlik.com/en-US/qlikview/November2017/Subsystems/Client/Content/Scripting/DateAndTimeFun...
If None of them are not working - We may ask input and output result which you want to see Here are the some tips
 sakshikaul
		
			sakshikaul
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		DaysOfComp is not a number. It is in date format
value of DaysOfComp is calculated in following formula
=(lastDate)-compday
and when DaysOfcomp is taken as a text box its value is shoen below

 sakshikaul
		
			sakshikaul
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi I am not able to see 'use advanced editor option' to upload application

