0

I have problem with the query:

=Query(Raw_Data!J$2:$BL,"Select J, Sum(U),Sum(V),Sum(W),Sum(X),Sum(Y),Sum(Z),Sum(AA),Sum(AB),Sum(AC),Sum(AD),Sum(AE),Sum(AF) where J contains 'CUS' and (AL='1-Revenues') and (AJ='Not CAPEX' or AJ='Unconfirmed CAPEX') and (AH='Not Intercompany') and (AM='2-Learn') and (M='2-B2B') Group By J",0)

That works fine, I get almost 90% of what I need BUT, basically, I've another column in the range (P), that I wanna see on the right of column J.

The situation is like this:

J .  P

A . 1
B . 2
C . 2
D . 3
E . 4
F . 1

I'd like to see Column P results on the right of Column J (that I already get with the above formula), then the sums (that already came out from that formula).

How can I add column P?

2
  • Hi Simone, it would greatly help if you could provide a link to a dummy sheet with th query implemented. Also, would it be possible to simplify your question to show what exactly you're struggling with? It's a little specific at the moment making it hard to understand what exactly you're trying to achieve. Commented Oct 15, 2019 at 19:30
  • Using your data (output of the query = 2 columns), just add another Query on top of it like this =query(ORIGINAL_FORMULA(),"SELECT Col2,Col1") to swap the columns.
    – pjmg
    Commented Oct 16, 2019 at 12:54

1 Answer 1

1

Add P after J both on the Select clause and the the Group By clause using a comma as separator:

=Query(Raw_Data!J$2:$BL,"Select J, P Sum(U),Sum(V),Sum(W),Sum(X),Sum(Y),Sum(Z),Sum(AA),Sum(AB),Sum(AC),Sum(AD),Sum(AE),Sum(AF) where J contains 'CUS' and (AL='1-Revenues') and (AJ='Not CAPEX' or AJ='Unconfirmed CAPEX') and (AH='Not Intercompany') and (AM='2-Learn') and (M='2-B2B') Group By J, P",0)

Related

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.