5 Answers, 1 is accepted
0
Massimiliano Bassili
Top achievements
Rank 1
answered on 20 Feb 2013, 08:19 AM
There is a "-" operator (Operators)
0
Yogesh
Top achievements
Rank 1
answered on 20 Feb 2013, 04:45 PM
Yes but my date is structured differently. This is what my sql query returns. And i when i make the crosstab query it gives me the total at the bottom as 150 which is fine, but i need a net meaning payment minus refund. I tried using iif condition to add anything that says payment and subtract anything that says refund, but no luck to create the difference. I want the subtotal to return 50 not 150. Please help.
Type Amount
Payment 100
Refund 50
Type Amount
Payment 100
Refund 50
0
Squall
Top achievements
Rank 1
answered on 20 Feb 2013, 04:53 PM
What expression you have used? I have done something similar:
= Sum(IIF(Fields.Label ="Refund", -Fields.Amount, Fields.Amount))
0
Yogesh
Top achievements
Rank 1
answered on 20 Feb 2013, 05:12 PM
I tried in 2 ways.
First one
=iff(Fields.Type='Payment', Sum(Fields.Amount,0))-iff(Fields.Type='Refund', Sum(Fields.Amount,0))
Second way
=sum(iif(Fields.Type='Payment', Fields.Amount,0)-sum(iif(Fields.Type='Refund', Fields.Amount,0)
And none of those syntax work...
First one
=iff(Fields.Type='Payment', Sum(Fields.Amount,0))-iff(Fields.Type='Refund', Sum(Fields.Amount,0))
Second way
=sum(iif(Fields.Type='Payment', Fields.Amount,0)-sum(iif(Fields.Type='Refund', Fields.Amount,0)
And none of those syntax work...
0
Hi Yogesh,
Peter
the Telerik team
Generally the suggested solution should work. Check out the attached sample, to run it you only have to copy the archived files in our report examples project, that came with your Telerik Reporting installation.
If you still experience any further difficulties we will appreciate if you open support thread and send us a runnable sample to review on our end.
Peter
the Telerik team
See what's new in Telerik Reporting Q1 2013. Register for the March 4 webinar to witness the impressive new visualizations in Telerik Reporting. Just for fun, 10 webinar attendees will be randomly selected to win a Telerik T-shirt and a $50 Gift Certificate to ThinkGeek. Register now! Seats are limited!