Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 Rdouto
		
			Rdouto
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Bonjour,
J'aimerais compter le nombre de fois qu'apparaît l'expression 'Late' après avoir écrit l'expression suivante :
if(isnull([Current maturity gate]), 'missing', if ([Current maturity gate] = 'G0', if (today()>[G0 date],'Late','OK'),
if ([Current maturity gate] = 'G2', if (today()>[G2 date],'Late','OK'),
if ([Current maturity gate] = 'G5', if (today()>[G5 date],'Late','OK'),
if ([Current maturity gate] = 'G9', if (today()>[G9 date],'Late','OK'),'')))))
Ce code (qui fonctionne bien, j'ai vérifié au travers d'un tableau) renvoie 'Late', 'OK' ou rien selon la date d'aujourd'hui et les dates enregistrées G-2-5-9.
J'ai tenté quelque chose comme ça mais cela me donne -1 :
sum(distinct if(isnull([Current maturity gate]), 'missing', if ([Current maturity gate] = 'G0', if (today()>[G0 date],'Late','OK'),
if ([Current maturity gate] = 'G2', if (today()>[G2 date],'Late','OK'),
if ([Current maturity gate] = 'G5', if (today()>[G5 date],'Late','OK'),
if ([Current maturity gate] = 'G9', if (today()>[G9 date],'Late','OK'),'')))))='Late')
J'espère que vous avez bien compris mon besoin, n'hésitez pas si vous avez des questions,
Bien à vous,
 
					
				
		
 brunobertels
		
			brunobertels
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Bonjour
tu comptes des occurrences texte donc il faut utiliser count() et non sum() :
COUNT(distinct if(isnull([Current maturity gate]), 'missing', if ([Current maturity gate] = 'G0', if (today()>[G0 date],'Late','OK'),
if ([Current maturity gate] = 'G2', if (today()>[G2 date],'Late','OK'),
if ([Current maturity gate] = 'G5', if (today()>[G5 date],'Late','OK'),
if ([Current maturity gate] = 'G9', if (today()>[G9 date],'Late','OK'),'')))))='Late')
 Rdouto
		
			Rdouto
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Merci pour ta réponse rapide !
J'avais essayé aussi avec Count, le seul soucis c'est que j'obtiens la même réponse si je veux compter les 'OK' ou les 'Late' alors que ça ne devrait pas être le cas 😕
 
					
				
		
 brunobertels
		
			brunobertels
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		bonjour
Peut etre ceci
count( distinct if(isnull([Current maturity gate]), 'missing',
if ([Current maturity gate] = 'G0' and today()>[G0 date],'Late',
if ([Current maturity gate] = 'G2' and today()>[G2 date],'Late',
if ([Current maturity gate] = 'G5' and today()>[G5 date],'Late',
if ([Current maturity gate] = 'G9' and today()>[G9 date],'Late','OK')))))='Late')
 Rdouto
		
			Rdouto
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Bonjour,
Malheureusement ça ne fonctionne toujours pas... Merci quand même pour l'idée. En fait je n'obtiens pas ce que je souhaite. Avec ce que tu as écrit j'obtient "2", ce qui est normal puisqu'on demande les deux valeurs distinctes "Late" et "OK" et non le nombre de fois que "Late" apparaît. Je ne sais pas comment traduire cela en code.
 Rdouto
		
			Rdouto
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Je pourrais utiliser une variable qui s'incrémente de une unité à chaque fois que l'outil rencontre un projet "Late" non ? C'est possible de faire ça sur Qlik sense ?
