简体   繁体   中英

SSRS Reporting Logic sql server

I have a parameter for Net Profit target so if i enter 0.10 it =10% my report looks at products that Does not meet the specified target and the last column suggests the minimum retail selling price the product would need to meet the target

to get net profit i use

   (NetRtl-Cost)/NULLIF(GrsRtl,0) as NP 

say the result was 0.04 = 4%

i need the minimum NetRtl to make my NP = 10%

but when i do @NPTARGET + COST * GRSRTL this doesnt work

I think you want something that checks to see if the current margin is less than the parameter and if it's less, calculate a new price:

=IIF(ISNOTHING(FIELDS!GrsRtl.Value), "None Sold", 
 IIF( (FIELDS!NetRtl.Value - FIELDS!Cost.Value) / FIELDS!GrsRtl.Value < Parameters!NPTARGET.Value, FIELDS!Cost.Value * (1.0 + Parameters!NPTARGET.Value), 
 "OK") )

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