What is Q in the quantitative theory of money? I am testing the quantitative theory of money for South Africa. QP = Mv. It is fairly clear what M and P are (broad money, or M1, price index, etc). But I am puzzled with Q. Is it GDP or does it include also intermediary inputs?

The idea of the theory is that prices depend on the amount of money and the quantity of "goods and services". But since companies and people also pay for intermediate goods and services, I think I need to consider also intermediate inputs and not only final goods and services, as in GDP.

Any ideas? Thank you very much!
Assume there are two agents in an economy, $A$ and $B$, (and some costless transaction mechanism). Per time period, agent $A$ produces alone quantity of intermediate good $q_A$. Agent $B$, thorugh a company where it is shareholder, buys this quantity, the company inputs also some other intermediate good , say $q_B$, and the two together through a production function result in a final good quantity $(q_A,q_B) \to Q$. $Q$ is then bought by agent $A$ and agent $B$ as consumers, at price $P$. $PQ &gt; p_Aq_A$ since it embodies a larger amount of productive resources (assume no inflation, which is not essential here).

Now, for the first transaction to take place, the buying of intermediate good $q_A$, we need quantity of money $M_A=p_Aq_A$. This quantity of money is now held by agent $A$. How much money we want, in order to facilitate also the purchasing by both consumers of the final good? 

It will depend on what kind of transactions we envisage to the end of the cycle.  Agent $A$ already has $M_A = p_Aq_A$ with which he can buy part of the final good. If $B$ buys the good pior to any other interaction with $A$, then $B$ must also hold quantity of money equal to $M_B = PQ - p_Aq_A$.  So the total quantity of money needed, in this scenario, is $PQ$, and the intermediate goods do not enter the final equation of the quantitative theory of money.  

Assume now that the only quantity of money available is $p_Aq_A$. What can we do to facilitate all transactions? Well, agent $A$ can buy first a part of the final good from company belonging to $B$, then the company will give the money to $B$ as dividends, and then $B$ will give the money to the company as consumer buying the rest of the final product. But in order for the transactions to happen sequentially as described, and be completed within the same time period as previously, money must "move faster". So in such a situation, the velocity of money will be higher than unity. 

$$PQ = \left(\frac{PQ}{p_Aq_A}\right) \cdot M$$

where the term in the parenthesis is $\left(\frac{PQ}{p_Aq_A}\right)\equiv \mathbf v$, the velocity of money. But again, the "product" side of the equation will be $PQ$. No counting of intermediate goods.