Jan 31, 2023 08:50 AM
Hi everybody!
I'm trying to modify the formula below so that the empty lines don't show up and don't make a line break with empty lines.
For each of the 18 lines I have {FormatX EANX Concatenated} from an other field where {FormatX EANX Concatenated} can be empty or not.
If the {FormatX EANX Concatenated} is empty, I don't want an empty line.
Solved! Go to Solution.
Jan 31, 2023 10:57 AM - edited Jan 31, 2023 01:07 PM
Hey @Vianney!
Try this formula:
TRIM(
IF(
{Format1 EAN1 Concatenated},
{Format1 EAN1 Concatenated} & "\n"
)
&
IF(
{Format2 EAN2 Concatenated},
{Format2 EAN2 Concatenated} & "\n"
)
&
IF(
{Format3 EAN3 Concatenated},
{Format3 EAN3 Concatenated} & "\n"
)
&
IF(
{Format4 EAN4 Concatenated},
{Format4 EAN4 Concatenated} & "\n"
)
&
IF(
{Format5 EAN5 Concatenated},
{Format5 EAN5 Concatenated} & "\n"
)
&
IF(
{Format6 EAN6 Concatenated},
{Format6 EAN6 Concatenated} & "\n"
)
&
IF(
{Format7 EAN7 Concatenated},
{Format7 EAN7 Concatenated} & "\n"
)
&
IF(
{Format8 EAN8 Concatenated},
{Format8 EAN8 Concatenated} & "\n"
)
&
IF(
{Format9 EAN9 Concatenated},
{Format9 EAN9 Concatenated} & "\n"
)
&
IF(
{Format10 EAN10 Concatenated},
{Format10 EAN10 Concatenated} & "\n"
)
&
IF(
{Format11 EAN11 Concatenated},
{Format11 EAN11 Concatenated} & "\n"
)
&
IF(
{Format12 EAN12 Concatenated},
{Format12 EAN12 Concatenated} & "\n"
)
&
IF(
{Format13 EAN13 Concatenated},
{Format13 EAN13 Concatenated} & "\n"
)
&
IF(
{Format14 EAN14 Concatenated},
{Format14 EAN14 Concatenated} & "\n"
)
&
IF(
{Format15 EAN15 Concatenated},
{Format15 EAN15 Concatenated} & "\n"
)
&
IF(
{Format16 EAN16 Concatenated},
{Format16 EAN16 Concatenated} & "\n"
)
&
IF(
{Format17 EAN17 Concatenated},
{Format17 EAN17 Concatenated} & "\n"
)
&
IF(
{Format18 EAN18 Concatenated},
{Format18 EAN18 Concatenated} & "\n"
)
)
Jan 31, 2023 10:57 AM - edited Jan 31, 2023 01:07 PM
Hey @Vianney!
Try this formula:
TRIM(
IF(
{Format1 EAN1 Concatenated},
{Format1 EAN1 Concatenated} & "\n"
)
&
IF(
{Format2 EAN2 Concatenated},
{Format2 EAN2 Concatenated} & "\n"
)
&
IF(
{Format3 EAN3 Concatenated},
{Format3 EAN3 Concatenated} & "\n"
)
&
IF(
{Format4 EAN4 Concatenated},
{Format4 EAN4 Concatenated} & "\n"
)
&
IF(
{Format5 EAN5 Concatenated},
{Format5 EAN5 Concatenated} & "\n"
)
&
IF(
{Format6 EAN6 Concatenated},
{Format6 EAN6 Concatenated} & "\n"
)
&
IF(
{Format7 EAN7 Concatenated},
{Format7 EAN7 Concatenated} & "\n"
)
&
IF(
{Format8 EAN8 Concatenated},
{Format8 EAN8 Concatenated} & "\n"
)
&
IF(
{Format9 EAN9 Concatenated},
{Format9 EAN9 Concatenated} & "\n"
)
&
IF(
{Format10 EAN10 Concatenated},
{Format10 EAN10 Concatenated} & "\n"
)
&
IF(
{Format11 EAN11 Concatenated},
{Format11 EAN11 Concatenated} & "\n"
)
&
IF(
{Format12 EAN12 Concatenated},
{Format12 EAN12 Concatenated} & "\n"
)
&
IF(
{Format13 EAN13 Concatenated},
{Format13 EAN13 Concatenated} & "\n"
)
&
IF(
{Format14 EAN14 Concatenated},
{Format14 EAN14 Concatenated} & "\n"
)
&
IF(
{Format15 EAN15 Concatenated},
{Format15 EAN15 Concatenated} & "\n"
)
&
IF(
{Format16 EAN16 Concatenated},
{Format16 EAN16 Concatenated} & "\n"
)
&
IF(
{Format17 EAN17 Concatenated},
{Format17 EAN17 Concatenated} & "\n"
)
&
IF(
{Format18 EAN18 Concatenated},
{Format18 EAN18 Concatenated} & "\n"
)
)
Jan 31, 2023 01:05 PM
Hi @Ben_Young1 I have added a few comma missing in your code ...... and it works! 😀
Thank you very much! I didn't think tu use the TRIM function that I need to improve to use.
Thanks a lot! 🙏
Jan 31, 2023 01:08 PM
Woops... appreciate the pointer on the missing commas!
Just corrected the original snippet.
Happy to help!
Sep 30, 2023 10:46 AM
I have a similar problem with my script that do not work : I'm trying to modify the formula below so that the empty lines don't show up and don't make a line break with empty lines.