Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all
Hope someone can help me with this, probably easy question, but I'm a beginner [:)]
I'm trying to get sum of salesprice if a number of conditions are present.
The first expression seems to get the right sum, but when I want to apply a condition more I can't seem to get the right result.
Sum(if(Invoicestatus='Accept' and Invoicetype='Debet'or Invoicetype='Kredit', [Slv Salesprice]))
This seems to get the result I want here, but then I want to only get the sum where also field 'Vgr' are between 010 & 800
But I can't seem to get it right
Field Vgr have entry's from 010 to 999
Thanks
Niels
Hi,
If i understood your question properly,below is the solution.
Sum(if(Invoicestatus='Accept' and Invoicetype='Debet'or Invoicetype='Kredit' and (Vgr>=010 and Vgr<=888), [Slv Salesprice]))
You could also write the same expression in Set analysis.
Sum({<Invoicestatus={'Accept'},Invoicetype={'Debet','Kredit'},VGR={">=010<=888"}>}[Slv Salesprice])
Hope this helps you.
- Sridhar
Hi,
I think you need to nest your control statements correct, notice the extra parenthesis:
Sum(if( (Invoicestatus='Accept' and Invoicetype='Debet') or Invoicetype='Kredit', [Slv Salesprice]))