use of for fonction
Hello ninox!
I struggle with the for function (I think this is the one I need but maybe it could be where...)
Here is my script:
(sum('PV coque PRO à date') + sum(Options.'PV Option t')) * 'Quantité'
I would like to add a condition on 'PV Option t' something like:
(sum('PV coque PRO à date') + sum(Options.'PV Option t' where /for Options.Base= true)) * 'Quantité'
Any Idea about the way to write this script?
Thanks a lot!
4 replies
-
Hi
for is used to loop through an array
for a in select table do do something here using a... end
where is used to scope the array returned with a select command
for a in select table where condition is true do do something here using a... end
What you need in your code is square brackets [], which takes a subset of an array, so your code would look something like
(sum('PV coque PRO à date') + sum(Options[Options.Base].'PV Option t')) * 'Quantité'
You don't need the = true bit
Hope that helps
John
-
So pleased. All the best.
-
if you are satisfied with John's help, please mark the post answered. thanks.
Content aside
- Status Answered
- 2 days agoLast active
- 4Replies
- 39Views
-
3
Following