question

akulka58 avatar image
akulka58 asked

SSRS TABLE & SUM IIF ISSUE

Hi All, I am new to SSRS. I am facing 2 issues. Issue No 1 – I have created 1 table. Please refer below image. ![alt text][1] Where I manually typed cost of tax. But when I am previewing report it’s come in all rows. Please refer below image. ![alt text][2] I do not need Cost of Tax in all rows I need it only in one row. How can I do this? Issue No 2 – I have created expression right to Cost of tax. Below is the function. =sum(iif(Fields!RevisionNumber.value = 2,Fields!Status.value = 3,Fields!ShipMethodID.value = 4,Fields!TaxAmt,0) The function is not working properly. Please guide me. The final output in report should be like Cost of Tax 11512 [1]: /storage/temp/1403-cost+of+tax.png [2]: /storage/temp/1404-preview+issue.png
ssrsssrs-2008ssrs-2008-r2ssrs-2012
cost of tax.png (2.3 KiB)
preview issue.png (1.5 KiB)
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Mister Magoo avatar image
Mister Magoo answered
Try this for the expression maybe, you haven't explained what the logic should be, so I guessed at AND... =sum(iif(Fields!RevisionNumber.value = 2 AND Fields!Status.value = 3 AND Fields!ShipMethodID.value = 4,Fields!TaxAmt,0)) the IIF function takes 3 arguments only - the first is an expression that returns a boolean, the second is the result if the boolean evaluates as true, the third is the result if the boolean evaluates as false. And you were missing the final bracket. The table display problem is because you are looking for a total, but have not told the report that...make that row a group (you can group by a column in the data or just a fixed string if you want every row in the dataset to be included in the group) instead and it will work.
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

akulka58 avatar image akulka58 commented ·
Thanks lot for your help. It really helping me.
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.