Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All
I have a Field Discount in my Table
When i select BRNAD_P = HAKKO or MITSUBISHI Discount = 0
May i know how to make it = 1 ? ( Because List Price * Discount = Net Price , If Discount = 0 , Net price will be zero )
left join (PRICE)
Load PART_NO_,
'USD '& LIST_PRICE as PRICE_LIST,
1-Discount as Discount_
Resident PRICE;
My Question is how to add some more script to below code , so that when it see 0 it will replace with 1 :-
1-Discount as Discount_
Well, if you want back-end solution try:
If(Isnull(Discount) or Len(Trim(Discount))=0 or Discount=0, 1, Discount) as _Discount
Hi All
Enclosed my QV doc.
Paul
For get to mentioned for testing you need to create a folder at C:\GE
Hi Paul,
You can add a condition statement in your code as :
If(Discount_ = 0,1,Discount_) as Discount
and then use this field Discount in place of Discount_
Hope this helps!
Hi Paul,
At the front-end you can use this formula for discount:
If(SUM(Discount)=0,1,Sum(Discount))
Hi Shy
I try :-
If(Discount = 0,1,Discount) as Discount_
I still get 0.
Any idea ?
Paul
Hi Tres
when i try your script :-
If(SUM(Discount)=0,1,Sum(Discount)) as Discount2,
I get error msg. expression error. may be i misunderstand your suggestion.
Paul
Hi Tres
Now i understand what you mean , it work when i use your script at expression.
But for my application , i intend to make use of load script to cal the net price. any idea how to make load script work ?
Paul
Well, if you want back-end solution try:
If(Isnull(Discount) or Len(Trim(Discount))=0 or Discount=0, 1, Discount) as _Discount
Hi Tres
Thank you vey much it work fine now.
Paul