Forum Discussion

afrutos's avatar
afrutos
Resolver I
4 years ago
Solved

Calculate in matrix

Hello everyone, how are you?
I have a question that I am having trouble solving.
I have a table with invoices (IdInvoices) and their amounts, on the other hand I have a table of Credit, which rectify these invoices, where I have (IDInvoice, idCredit, amounts)

I need to get the matrix in such a way that for each invoice I get the amount of that invoice, and in the lower row I get the amount of the credit note corresponding to that invoice, but I do not know how to calculate it.

Can someone help me? Thanks

 

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi, 

    You can make a measure something like this:  if(isinscope[creditnote],sum(CreditnoteAmount), sum(invoiceAmount),

    --> Isinscope[] captures the rowlevel, starts with the lowest/desired rowlevel.

    ---> IF function can be replaced by SWITCH() --> play with variables to make the measure better readable 

     

     


3 Replies

  • Hello afrutos ,


    Request you to please provide sample data with expected result in tabular format.

     

    Cheers,

    Shishir

    • afrutos's avatar
      afrutos
      Resolver I

      Hi yes, this is an example of what i need

       

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi, 

    You can make a measure something like this:  if(isinscope[creditnote],sum(CreditnoteAmount), sum(invoiceAmount),

    --> Isinscope[] captures the rowlevel, starts with the lowest/desired rowlevel.

    ---> IF function can be replaced by SWITCH() --> play with variables to make the measure better readable