0

select and sum the same date values

how can I sum values in a Table1 without the same date?

I write this but don't work:

let c := Client;
sum(unique(select Table1)['Invoice'.'Date' and c = Client].'Amount')

Thank you!

5 replies

null
    • Sal
    • 4 yrs ago
    • Reported - view

    Hi!

    I need to add values only if the dates of the documents are different...

    Please can someone help me?

    let c := Client;
    let d := 'Invoice'.'Date';
    sum((select Table1 where Client = c and d != 'Invoice'.'Date').'Amount')

    Thank you!

    • Ninox Software
    • David_G
    • 4 yrs ago
    • Reported - view

    This can definitely be achieved but we will need more information to be able to assist you. I recommend you book a free screen-sharing appointment where one of our experts can walk you through the solution. https://calendly.com/ninoxenglish

     

    Thanks.

    -David

    • Nick
    • 4 yrs ago
    • Reported - view

    One idea is to create a formula and idendify the duplicates:

    let myDate := Date;
    if cnt(select Table1 where Date = myDate) > 1 then
    1
    end

    ---

    then, another formula:

    sum((select Table1)[Duplicate = null].Amount)

     

    Is this what you want?

    • Sal
    • 4 yrs ago
    • Reported - view

    Than you Nick,

    I would like the sum of the values (VAT) that are not duplicates of the same invoice

    Schermata 2019-11-07 alle 15.57.41

    I would like the VAT of the same invoice to be added only once

    • Sal
    • 4 yrs ago
    • Reported - view

    I've tried that code... but don't work:

    let dates := unique(Pagamenti.'FATTURE INVIATE'.Numero);
    for i from 0 to cnt(dates) do
    if cnt(select MOVIMENTI where 'FATTURE INVIATE'.Numero = item(dates, i)) > 1 then
    sum((select MOVIMENTI)['FATTURE INVIATE'.Numero = null].'IVA in Fattura')
    end
    end

Content aside

  • 4 yrs agoLast active
  • 5Replies
  • 1324Views