Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
t_guet01
Contributor II
Contributor II

How do I sum a product consisting of a measure and a dimension?

Hey guys,

 

I am currently trying to create a simple sum measure:

sum(Price*Quantity)

 

Quantity is given as a dimension in the facts table. However, price is computed via multiple if-clauses.

 

An error occurs in case I am trying to multiply the Price measure by Quantity dimension:

 

Error: sum([Price] * Quantity).

 

I tried to outsourc the pretty long formula for price to the script by a set:

set Price=
'if(Flag='accept'rangemin(MarketPrice,StrategicPrice), [...] )))))

However that doesn't work because of the > ' < within the set.

 

That brings me to the question: how do I sum a product over a measure and dimension?

 

Thanks and best

T

Labels (1)
3 Replies
andrey_krylov
Specialist
Specialist

Hi,  try to remove first and last quotes  or double inner quotes

RafaelBarrios
Partner - Specialist
Partner - Specialist

Hi @t_guet01 

What is [Price] with the brackets ?

the same variable you are pasting, a fields, a master measure?

Check if [Price] could be meaning more Than one thing in your model,

 

best,

sidhiq91
Specialist II
Specialist II

@t_guet01 Can you please post some sample data that would help us to understand and resolve the issue.