Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 
					
				
		
Hi all,
I have 2016 and 2015 years records in my table.
i Need to display only max year months datA in bar graph that too last 3 months
so I filter the data in script level where year(asofdt)>2015.
Then i am getting the bar with set analysis. As of now it is ok but
this application will get 2017 data, that time how to get max year values dynamically
PLease help help me to solve
 Kushal_Chawda
		
			Kushal_Chawda
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		MaxYear:
LOAD Year(Max(asofdt)) as MaxYear
FROM Table;
let vMaxYear = peek('MaxYear',0,'MaxYear');
Data:
LOAD *
FROM table
where year(asofdt)='$(vMaxYear)'
 tresesco
		
			tresesco
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		If you are looking for current year data, you can try like:
Where year(asofdt)=Year(today());
If it is dependent on data, you could create a variable like:
Load
max(asofdt) as MaxDt
From <>;
vMaxYear=Peek('MaxDt');
Then ..
Load
*
From <> Where year(asofdt)='$(vMaxYear)';
 
					
				
		
 varshavig12
		
			varshavig12
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		where year(asofdt)= max(Year(asofdt))
 
					
				
		
 sujeetsingh
		
			sujeetsingh
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		You need to add a dynamic mechanism to handle upcoming years. Tresco suggested a good way but it is half done.
You need to handle both max YEAR as well as Today. The reason behind this is what if the data is having only data till 2016 and you are running the report in 2017 ?
 
					
				
		
You want latest 3 months or maximum date?
 Kushal_Chawda
		
			Kushal_Chawda
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		MaxYear:
LOAD Year(Max(asofdt)) as MaxYear
FROM Table;
let vMaxYear = peek('MaxYear',0,'MaxYear');
Data:
LOAD *
FROM table
where year(asofdt)='$(vMaxYear)'
 
					
				
		
Thank you guys
 
					
				
		
It's working....! Thanks you
