Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 
					
				
		
 danosoft
		
			danosoft
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi i have a table with some column, i want display the value of coloum SOURCING only when my YEAR is 2017, when year is < 2107 i want display in this column the value 0
Is possible to do that in a table?
thanks
 
					
				
		
 pradosh_thakur
		
			pradosh_thakur
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		LOAD
ANNO,
SOURCING,
if(SOURCING=2017,SOURCING,0) as SOURCING_COPY
SQL SELECT *
FROM "XXX"."V_XXX_16_17";
As per your condition sourcing should be 2017 or else zero.. so check that then do it. make sure you write field name properly
 YoussefBelloum
		
			YoussefBelloum
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi Daniele,
you can do this by using a condition in the dimension, try this:
=if(date < YearEnd(today()), date, 0)
if you have only a field year in your model, you can filter directly on the year:
=if(Year = year(today()), year, 0)
 
					
				
		
 danosoft
		
			danosoft
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi, sorry but is not a GRAPH object is a Table object, i not have dimension
 YoussefBelloum
		
			YoussefBelloum
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		A table box does not support calculations.
What can you do is select that field based on a button or trigger or try to make specific calculations on the script.
 
					
				
		
 danosoft
		
			danosoft
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Sorry i understand that i can't do that, but i not understand what you mean for "based on a button or trigger" or making specific calculation on a script... how can i do that?
 YoussefBelloum
		
			YoussefBelloum
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		You can use a button to make a selection of the year you want, so the table will update on that selection.
you can also create a trigger that can be launched on multiple things, like when you open the app, when you open a sheet, etc...
about the calculation on the script: you can use a second load with a "where" condition for the year you want and concatenate this load on the first table.
tell me if it is clear.
Regards,
Youssef
 
					
				
		
 pradosh_thakur
		
			pradosh_thakur
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		This is easy to do with a straight table but with table box it is hard may be not possible.
but one workaround you can do is by adding an extra column in the model sourcing_copy
sourcing_copy expression ->if(sourcing=2017,sourcing,0) as sourcing_copy
in place of 2017 you can get the current year using function.
hope this helps.
Regards
Pradosh
 
					
				
		
 danosoft
		
			danosoft
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		you mean i can put in my model like this?:
LOAD
ANNO,
"SOURCING",
if(sourcing>2017,sourcing,0) as sourcing_copy
SQL SELECT *
FROM "XXX"."V_XXX_16_17";
 
					
				
		
 pradosh_thakur
		
			pradosh_thakur
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		LOAD
ANNO,
SOURCING,
if(SOURCING=2017,SOURCING,0) as SOURCING_COPY
SQL SELECT *
FROM "XXX"."V_XXX_16_17";
As per your condition sourcing should be 2017 or else zero.. so check that then do it. make sure you write field name properly
