title: Need google query to only show sum of items greater than value from cell and another query to sum values based on selection
body: <p>I have 2 queries which need to be answered:</p>
  
  <p>A)</p>
  
  <pre><code>=QUERY(Data!B:T,"select F, sum(I), sum(T) where D is not null AND E contains '"&amp;Q2&amp;"' AND G contains '"&amp;S2&amp;"' AND B contains '"&amp;Q4&amp;"' group by F order by sum(I) desc label sum(I) 'الكمية', sum(T) 'القيمة'",1)
  </code></pre>
  
  <p>I would like to add the condition to only show values greater than what is entered in cell 'S3'. I tried adding <strong>AND sum(I) >= "&amp;S3&amp;"</strong> but it showed an error. I tried with shifting quotes but nothing. How do I achieve this? Maybe with another query?</p>
  
  <p>B)</p>
  
  <pre><code>=QUERY(Data!B:I,"select E, sum(I) where D is not null AND B contains '"&amp;G4&amp;"' AND C &gt;= date '"&amp;TEXT(G2,"yyyy-mm-dd")&amp;"' AND C &lt;= date '"&amp;TEXT(I2,"yyyy-mm-dd")&amp;"' group by E pivot G order by E",1)
  </code></pre>
  
  <p>I have a drop down list in cell 'I3' with 2 options, 'الكمية' and 'القيمة' and I would like the query to give me sum of values in 'I' in case of 'الكمية' and 'N' in case of 'القيمة'. How do I achieve it?</p>
  
  <p>Thank you.</p>