Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 khaycock
		
			khaycock
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Is it possible to create a field based on a date? I wanted to create a field that shows deciphers whether data is pre-2019 or post-2019.
The date field I'm using has the format MMM DD, YYYY hh:mm:ss so would need to be split at Jan 01, 2019, 00:00:00 if possible?
 khaycock
		
			khaycock
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		My dashboard displays loads of security patches and their 'First Observed Date' field. I need to have a field that allows the user to drill using a field whether the patch was first observed before 31/Dec/2018 or after 01/Jan/2019 (new management processes went into access on Jan 1st so need to see the difference between all the data before 2019 and for all the data that comes after
 dplr-rn
		
			dplr-rn
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		 khaycock
		
			khaycock
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		I was hoping we could force it to be anything >=2019. So anything that is equal to or larger than 2019 it would pick it up, therefore picking up 2019 and 2020?
 dplr-rn
		
			dplr-rn
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		 khaycock
		
			khaycock
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		I wasn't sure because of the first half of the expression you gave me..
"if(Year(date(FirstDiscoveredAgain))= '2019',2019,"
Does that not make it equals to 2019 only?
 dplr-rn
		
			dplr-rn
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		No
you are create a new column/dimension 2019_Flag  while checking year of your date. see below in green
if(Year(DATEFIELD)=2019 //if Year of your date field is equal to 2019
, 2019 // then 2019
, if(Year(DATEFIELD)<2019,  //if Year of your date field is less than 2019
           'Pre 2019','Post 2019') //then Pre 2019 else Post 2019
) as 2019_Flag
 dplr-rn
		
			dplr-rn
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		