Search code examples
google-sheetsimportgoogle-sheets-formulauniquegoogle-query-language

How to using ABS equivalent in this query formula in Google Sheets?


The formula converts negative into positive and vice versa, but how can I get all numbers in Col8 to be positive?

=query(UNIQUE(IMPORTRANGE("https://docs.google.com/spreadsheets/d/ddddddddddddsssssssssssssssswwwwwwww/edit";"Sheet1!A1:K"));"select Col1, Col2, Col3, Col4, Col5, Col6, Col7, Col8*-1 where Col2 matches '"&B6&"' label Col8*-1 'Qtd' ")

Here's a copy of the sheet

Would there be an ABS() equivalent here?

Thank you!


Solution

  • try:

    =INDEX(QUERY(UNIQUE({
     IMPORTRANGE("1uU9zw9BbXp5hOO1f8fZEcgc8f8u8uZNjoeeuHI3SBpM"; "Sheet1!A1:K")\ABS(
     IMPORTRANGE("1uU9zw9BbXp5hOO1f8fZEcgc8f8u8uZNjoeeuHI3SBpM"; "Sheet1!H1:H"))});
     "select Col1,Col2,Col3,Col4,Col5,Col6,Col7,Col12 
      where Col1 is not null label Col12'Qty'"))
    

    enter image description here