title: Pyspark how to multiply one column with the result from another column -count in dataframe?
body: <p>I have this DF <code>salesDF</code>:</p>
  <pre><code>+-----------+-------------+----------------+----------------+----------+------------+----------------+---+----------+-------------------+
  |customer_id|customer_name|   email_address|shipping address|product_id|product_name|product_Category|qty|unit_price|          Timestamp|
  +-----------+-------------+----------------+----------------+----------+------------+----------------+---+----------+-------------------+
  |        301|       Jaison|jaison@gmail.com|       Bangalore|       402|      Laptop|     Electronics|  2|     28000|2017-03-10 07:29:00|
  |        321|         Abji| Abhji@gmail.com|       Bangalore|       402|      Laptop|     Electronics|  2|     28000|2017-03-12 10:29:00|
  |        302|          Tom|   tom@gmail.com|       Bangalore|       601|      Mobile|     Electronics|  1|     20000|2017-03-10 08:29:00|
  |        303|       Thomas|thomas@gmail.com|         Chennai|       402|      Laptop|     Electronics|  2|     38000|2017-03-10 08:45:00|
  |        307|        Vijay| vijay@gmail.com|         Chennai|       503|          TV|     Electronics|  1|     42000|2017-03-11 09:45:00|
  |        310|       Thomas|thomas@gmail.com|         Chennai|       503|          TV|     Electronics|  1|     42000|2017-03-12 09:45:00|
  |        308|        Menon| menon@gmail.com|       Hyderabad|       503|          TV|     Electronics|  2|     40000|2017-03-13 09:45:00|
  +-----------+-------------+----------------+----------------+----------+------------+----------------+---+----------+-------------------+
  </code></pre>
  <p>I am looking to find the total number of product sold in day.
  The product are purchased by customer with different quantity in each day
  so we have to calculate the total count of same product * qty</p>
  <p>Below what i tried to get the count</p>
  <pre><code>sale_of_product_in_a_day =sales_df.groupBy(F.substring('Timestamp', 0,10).alias('Per Day'),'product_name').count()
  
  </code></pre>
  <p>This basically give the result as</p>
  <pre><code>+----------+------------+-----+
  |   Per Day|product_name|count|
  +----------+------------+-----+
  |2017-03-12|      Laptop|    1|
  |2017-03-13|          TV|    1|
  |2017-03-12|          TV|    1|
  |2017-03-10|      Mobile|    1|
  |2017-03-10|      Laptop|    2|
  |2017-03-11|          TV|    1|
  +----------+------------+-----+
  </code></pre>
  <p>The above result based on the grouping of same product with out considering the 'qty' column..
  so i need to calculate 'qty' against the number of actual product the customer have purchased in day?</p>
  <p>so here in the case the expected result for the date '2017-03-10' should be '4' instead of '2' since the 'quantity' of 'Laptop' was 4</p>
  <h1>Expected</h1>
  <pre><code>|2017-03-10|      Laptop|    2| # should be ---&gt; 4
  </code></pre>
  <p>so how can multiply one column with the result of count in dataframe? or what is the approach to solve this?</p>
  <p>Appreciate if anybody can help with this.</p>
  <p>Thanks</p>