Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 Federicofkt
		
			Federicofkt
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		I'm performing an intersection in a set analysis.
I've built a table called "fatti" that stores rows of data from other tables in the data model, each table rows marked with a "TipoFatto" in the "fatti" table.
Now I want to make an intersection between rows of two different "TipoFatto", that's my code:
Count(DISTINCT 
{<
TipoFatto = {'APPF'}, 
[Appuntamenti.Flag_TAP_DC_AN] = {'010', '011'}, 
[Appuntamenti.FissatoDa] = {'Segreteria'}, 
Appuntamenti.TipoEntita = {'Aziende'} ,
key_CU = P({<TipoFatto = {'INT'}>})
>} 
key_CU
)
Basically I'm counting the key_CUs in the "APPF" rows that are also present in the "INT" rows, adding some filters to the APPF rows taken from table "appuntamenti".
It seems to work but I've noticed that if I build a table with months as dimension and this measure, for the month january 2024 it shows 156 but then, if I filter on january 2024 (same dimension of the table) the number drop to 43, that I think it's the correct value.
I don't understand why without specifically filtering it shows 156 instead of 43
 marksouzacosta
		
			marksouzacosta
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi @Federicofkt,
It is hard to help without the data but in cases like that I create a chart Table with all the columns involved in the measure, just dimensions, without any measure. This helps me a lot to understand the records.
Regards,
Mark Costa
Read more at Data Voyagers - datavoyagers.net
Follow me on my LinkedIn | Know IPC Global at ipc-global.com
 ckarras22
		
			ckarras22
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hello,
P({<TipoFatto = {'INT'}>}) doesn't respect the Table dimension (months) when nothing selected. As soon as you make a selection, P() takes the filtered, possible values for this particular month-year and intersects correctly with the rest of the Set analysis
