July 5Jul 5 Newbies HelloFrench user uneder FMPro Adv 18 I have a text field listing product quantities delivered by suppliers identified by their IDs (e.g., 20kg delivered by SOC258, 14kg by SOC87), with each entry separated by a line break.For some reason, there are several lines showing a delivery of 0 from certain suppliers;20 of SOC25814 of SOC870 of SOC340 of SOC456 I would like to remove these lines.Thanks for your advices
July 6Jul 6 You could use a looping script or the While() function to go over each value and test the first character or word. The script option could also split the passed entries into individual records in a related table, with separate fields for quantity and product ID, as one would expect in a relational database.Alternatively you could use the following expression* to filter out the 0 entries:FilterValues ( YourField ; Substitute ( ¶ & YourField ; "¶0" ; ¶ ) )--(*) based on a brilliant idea by Agnes Barouh
July 9Jul 9 Author Newbies C'est finalement la solution du script qui m'a été soufflée par un ami ! La joins ici pour profiter à d'autres !In the end, a friend suggested the script solution! I'm sharing it here so others can benefit from it! Dubau.fmp12
July 9Jul 9 I would streamline your script as:Show All Records Go to Record/Request/Page [ First ] Loop Set Variable [ $n; Value:ValueCount ( Dubau::Champ Avant ) ] Set Variable [ $i; Value:1 ] Loop Exit Loop If [ $i > $n ] Set Variable [ $value; Value:GetValue ( Dubau::Champ Avant ; $i ) ] If [ Left ( $value ; 1 ) ≠ "0" ] Set Field [ Dubau::Champ Apres; List ( Dubau::Champ Apres ; $value ) ] End If Set Variable [ $i; Value:$i + 1 ] End Loop Go to Record/Request/Page [ Next; Exit after last ] End LoopOr (as per my previous post) just:Show All Records Replace Field Contents [ Dubau::Champ Apres; Replace with calculation: FilterValues ( Dubau::Champ Avant ; Substitute ( ¶ & Dubau::Champ Avant ; "¶0" ; ¶ ) ) ] [ No dialog ]But I still suspect it would be better to split the qualifying values off to individual records and fields in a related table. Edited July 9Jul 9 by comment
Create an account or sign in to comment