Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 
					
				
		
Hi,
I have a COUNT() statement which looks like this in one of the expressions for a chart:
count ( {<Col1_in_Table1={1}>} DISTINCT Col2_in_Table2 )
Can someone let me know if I’m interpreting this statement correctly or not.
So if my data looks like this:
| Col1_in_Table1 | Col2_in_Table2 | 
| 1 | X | 
| 1 | X | 
| 1 | Y | 
| 0 | X | 
| 0 | X | 
Does the COUNT() in above return 2?
Thank you.
 
					
				
		
 swuehl
		
			swuehl
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Yes, two distinct Col2_in_Table2 values X and Y where Col1_in_Table1 equals 1.
But are the two columns really located in a single table or two?
 Peter_Cammaert
		
			Peter_Cammaert
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		That's correct if you use this expression in, say a text box or a chart or straight table without dimensions.
If you do apply dimensions to your expression, the dimension values may further reduce the result of this expression.
Best,
Peter
 
					
				
		
 miguelbraga
		
			miguelbraga
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Yes it returns 2 

Regards,
MB
 
					
				
		
Thanks. There are two tables involved here.
 
					
				
		
Thank you for the quick replies.
Just wanted to make sure I understand the syntax as i'm troubleshooting an app that was written by someone else.
 Peter_Cammaert
		
			Peter_Cammaert
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Moreover, as Stefan already indicated, the location may have an impact as well. You seem to place Col1 in Table1 and Col2 in Table2. Two separate tables then. How are rows in each table associated? No association will still return 2 as long as you do not select anything in Col2.
 
					
				
		
 miguelbraga
		
			miguelbraga
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Do you need my qvw? If not, does my answer gave you what you need? If so put it as the correct answer  Have nice job.
 Have nice job.
Regards,
MB
 
					
				
		
Hi Peter,
Yes, there's another column which links these two tables. I just gave a very simplied example but thanks for
pointing this out.
 
					
				
		
Hi Miguel,
Please post your qvw. QV is new to me.
Thanks
