using IIF expression to decide what formula to use for the field?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I want a datacolumn expression which will work out a value depending on the
value of child records here is the expression that does not work. if any1 can
help me that would be great

iif(child(Packaging).CasingFlag =
'Y',Sum(child(Packaging).PackagingCostPerKg) *
parent(ProductProductVariant).NetWeight,Sum(child(Packaging).PackagingCostPerKg) * parent(ProductProductVariant).GrossWeight)

also is it possible to refernce a chile or parent value through multiple
relationships?
thanks
 
I don't think the below can work, because when you say "child(Packaging)"
how does ADO.NET know what child and thru what relation? (Something like,
"Hey that's your kid" without specifying which girlfriend).

Could you post the two datatables involved in sample XML or flat file (not
too many rows I hope), and I could try and come up with a good solution :-).
My initial suspection is that DataTable.Expression might not work for you,
though I'll try.

- Sahil Malik
http://dotnetjunkies.com/weblog/sahilmalik
http://blogs.apress.com/authors.php?author=Sahil Malik





Gareth said:
Hi,
I want a datacolumn expression which will work out a value depending on the
value of child records here is the expression that does not work. if any1 can
help me that would be great

iif(child(Packaging).CasingFlag =
'Y',Sum(child(Packaging).PackagingCostPerKg) *
parent(ProductProductVariant).NetWeight,Sum(child(Packaging).PackagingCostPe
rKg) * parent(ProductProductVariant).GrossWeight)
 
Back
Top