Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join us at the Cloud Data and Analytics Tour! REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
ccb-it2013
Contributor
Contributor

What's wrong with this expression?

Hi guys,

Can someone tell me what is wrong with the expression below? Been staring at this too long, and I guess I don't see why the token doesn't match:

// For invoices and removing the pallets

sum(if(pallet<>'P' and trntype='I',

// For invoices and replacing price with paprice

(if(price<>0,(    //To check styles with 0 amount and not a pallet

    ((invqty)*price)*rate))),

   

    (((invqty)*pprice)

    *rate))),

   

// For credits

(((-(invqty)*price)*rate)

Please help.

Thanks,

E

3 Replies
vishsaggi
Champion III
Champion III

Try this?

= sum(

    if(pallet<>'P' and trntype='I',(if(price<>0,(((invqty)*price)*rate))), (((invqty)*pprice)*rate)),(((-(invqty)*price)*rate)))

sunny_talwar

May be this:

Sum(

     If(pallet <> 'P' and trntype='I',

          If(price <> 0, invqty * price * rate,

                              invqty * pprice * rate),

          -invqty * price * rate))

bill_markham

Overall there seems to be one more opening bracket than closing brackets.

Also the closing bracket for your sum( appears to be  before the comma at the end of the line before the // For credits comment.