Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Two formuals issue

HI guys,

I have an expression

Sum (if (TxnType<>'Estimate' and TxnType<>'Sales Order',Amount,0))

This works

But i need to do add something more to do it.

I need to add

If (TxnType = 'Credit', Amount*-1, Amount) to this same expression.

so basically i need is

SUM

(

     while (rowcount)

     {

          if (TxnType<>'Estimate' and TxnType<>'Sales Order') Then

               Amount = Amount;

          else

               Amount = 0;

          If (TxnType = 'Credit') Then

               Amount = Amount * -1;

          else

               Amount;

     }

)

Can you please tell me how to do that.

Thanks,

Saurabh

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Try

Sum (if (TxnType<>'Estimate' and TxnType<>'Sales Order',

          if(TxnType = 'Credit',-Amount,Amount)

          , 0)

          )

View solution in original post

2 Replies
swuehl
MVP
MVP

Try

Sum (if (TxnType<>'Estimate' and TxnType<>'Sales Order',

          if(TxnType = 'Credit',-Amount,Amount)

          , 0)

          )

Not applicable
Author

It is working.

Thanks!