Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 qliky88
		
			qliky88
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi Experts,
Is it possible to have the last 14 days as a dimension on a line chart, updating the dates as the days progress?
Thanks 🙂
 jwjackso
		
			jwjackso
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Use an expression as the dimension, suppress null values.
=If([DateField] >= Date(Floor(Now()-13),'M/D/YYYY'),Date([DateField],'M/D/YYYY'),Null())
The date format string is dependent on date field.
 jwjackso
		
			jwjackso
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Use an expression as the dimension, suppress null values.
=If([DateField] >= Date(Floor(Now()-13),'M/D/YYYY'),Date([DateField],'M/D/YYYY'),Null())
The date format string is dependent on date field.
 Kushal_Chawda
		
			Kushal_Chawda
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		You can create a flag in script instead of calculated dimension to have better performnace.
LOAD ..
if(Date>=today()-13 and Date<=today(),1,0) as Flag_14_Days
FROM table;
then in measure you can use set analysis to restrict the dimension value
=sum({<Flag_14_Days={1}>}Value)
 albertovarela
		
			albertovarela
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Other option is to create a measure with set analysis.
sum({$<Date={">=$(=Date(today()-14,'$(DateFormat)'))<=$(=Date(today()-1,'$(DateFormat)'))"}>}YourField)
 qliky88
		
			qliky88
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Thanks everyone for their responses 🙂
