简体   繁体   中英

Need help to write expression in ssrs to calculate a field on condition basis

i want to create field C from field A and field B the logic i want to use to calculate C field is this C=(A-(B*.05))<0,0 else value.

did you want an expression in a cell or a separate column for you dataset?

as a simple expression

=iif((fields!a.value - (fields!b.value * 0.05)) <0,0,(fields!a.value - (fields!b.value * 0.05)))

If you want it as a calculated column then simply right click on your dataset and select

Add Calculated Field, give it a suitable name and use the same expression above.

You should be able to then use this column in your report like any other column.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM