Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 theoat
		
			theoat
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Bonjour,
J'ai résolu un cas à l'aide de cette fonction. Mais lorsque j'augmente la volumétrie des données, l'objet affiche "mémoire objet insuffisante". Je pensais donc alléger cette fonction à l'aide d'un set analysis (ou autre si vous avez des recommandations.
sum(aggr( if(DateCommande>=max(total<Personne> DateLivraison),
		sum([Quantité])
    ),Personne,DateCommande))
Je vous laisse le jeu de données à télécharger et les réponses attendus en image.
LOAD * INLINE [
Personne,DateLivraison,Quantité,DateCommande
Igor,11/11/2022, 5,22/11/2023
Math,11/11/2022, 4,01/01/2023
Math,10/06/2023, 2,22/11/2023
Math,11/11/2022, 3,01/01/2023
Math,11/11/2022, 1,22/11/2023
Math,10/06/2023, 4,01/01/2023
Théo,10/08/2023, 3,01/01/2023
John,11/11/2022, 2,01/01/2023
John,10/08/2023, 2,22/11/2023
John,11/11/2022, 2,22/11/2023
John,10/06/2023, 1,01/01/2023
Jason,11/11/2022, 4,22/11/2023
Jason,10/06/2023, 5,01/01/2023
Filip,11/11/2022, 1,01/01/2023
Greg,11/11/2022, 1,22/11/2023
Greg,10/06/2023, 3,01/01/2023
David,11/11/2022, 2,01/01/2023
David,10/06/2023, 1,22/11/2023
David,11/11/2022,3 ,01/01/2023
Lola,11/11/2022, 2,23/11/2023
Lola,10/06/2023, 3,22/11/2023
]
;
Cordialement,
Théo ATRAGIE.
 LRuCelver
		
			LRuCelver
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		If the max(total<Personne> DateLivraison) doesn't need to be dynamic, I would ass a flag in the datamodel:
Data:
NoConcatenate Load
	Personne,
    Date(Date#(DateLivraison, 'DD/MM/YYYY')) as DateLivraison,
    Quantité,
    Date(Date#(DateCommande, 'DD/MM/YYYY')) as DateCommande
Inline [
Personne,DateLivraison,Quantité,DateCommande
Igor,11/11/2022, 5,22/11/2023
Math,11/11/2022, 4,01/01/2023
Math,10/06/2023, 2,22/11/2023
Math,11/11/2022, 3,01/01/2023
Math,11/11/2022, 1,22/11/2023
Math,10/06/2023, 4,01/01/2023
Théo,10/08/2023, 3,01/01/2023
John,11/11/2022, 2,01/01/2023
John,10/08/2023, 2,22/11/2023
John,11/11/2022, 2,22/11/2023
John,10/06/2023, 1,01/01/2023
Jason,11/11/2022, 4,22/11/2023
Jason,10/06/2023, 5,01/01/2023
Filip,11/11/2022, 1,01/01/2023
Greg,11/11/2022, 1,22/11/2023
Greg,10/06/2023, 3,01/01/2023
David,11/11/2022, 2,01/01/2023
David,10/06/2023, 1,22/11/2023
David,11/11/2022,3 ,01/01/2023
Lola,11/11/2022, 2,23/11/2023
Lola,10/06/2023, 3,22/11/2023
];
Join(Data) Load
	Personne,
    Max(DateLivraison) as MaxDateLivraison
Resident Data
Group By Personne;
Join(Data) Load Distinct
	Personne,
    DateCommande,
    If(DateCommande >= MaxDateLivraison, 1, 0) as Flag
Resident Data;
Drop Field MaxDateLivraison;You can then use a simple set analysis:
Sum({<Flag = {1}>} [Quantité])
					
				
			
			
				
			
			
			
			
			
			
			
		