Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
nickrider2
Contributor
Contributor

Could you please explain what's wrong with this syntax?

Hello everyone,
Where is the problem with this syntax? Please accept my sincere thanks
IF( ISPROJECTMAINORDER = '-1'
AND
ordercategory_code = '100'
AND
(sum(Total_cost_price_pbd) > 0.0), Total_cost_price_pbd,


(ISPROJECTMAINORDER = '-1'
AND
ordercategory_code = '100', TOTALNETAMOUNT * 0.65,
sum(SO_costprice)))

Labels (1)
1 Reply
lblumenfeld
Partner Ambassador
Partner Ambassador

I think you were missing an If statement. I've added that and reformatted so that you can check the logic.

See the second If statement in the code blow.
 
IF( ISPROJECTMAINORDER = '-1'
            AND
        ordercategory_code = '100'
            AND
        (sum(Total_cost_price_pbd) > 0.0), 
    Total_cost_price_pbd,
    If(   ISPROJECTMAINORDER = '-1'
                    AND
                ordercategory_code = '100', 
            TOTALNETAMOUNT * 0.65,
            sum(SO_costprice)
      )
  )