Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

IF statement in an expression

I am trying to wirte an IF statement in an expression to either Add or subtract sales and costs depeneding on whether the sales figure is a '+' or a '-'. my code so far is

Sum(Aggr(If([Sales]='+',  Sum([Sales Amount (Actual)])-([InvoiceLine_UnitCost]*[Invoiced Quantity]) ,

         If(
[Sales]='-', Sum([Sales Amount (Actual)])+([InvoiceLine_UnitCost]*[Invoiced Quantity])))))

The [Sales] tag is an existing column in the chart.



12 Replies
danieloberbilli
Specialist II
Specialist II

Please attach an example qvw file to have  a closer look

christian77
Partner - Specialist
Partner - Specialist

Hi.

Use set analysis.

Not applicable
Author

ok. Just trying to upload. For some reason the ability to upload to the discussion forum is greyed out in my menu.