Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
TomBond77
Specialist
Specialist

Error in expression: ')' expected

Hi experts

I have the following formula. There seems to be a ')' missing. I don't see where this might be the case?

Sum({$<Month={'$(=(month(today())))'}>}
([Quantity Total Stock] * ( Distinct TOTAL <Material> ValStockValue)) / ( Distinct TOTAL <Material> [Quantity Total Stock]))

Can you please help?

Thanks

Tom

1 Reply
JuanGerardo
Partner - Specialist
Partner - Specialist

Hi @TomBond77, you are using wrongly the aggregation function. Distinct and TOTAL modifiers can only be used once. I am not sure if you are trying to use more aggregation functions or a special calculation inside the Sum. For example, this should be syntactically correct but I think this is not what you want:

Sum(
	{$<Month={'$(=(month(today())))'}>}
	Distinct TOTAL <Material>
	([Quantity Total Stock] * ValStockValue)
	/ 
	[Quantity Total Stock]
	)

JG