Concatenate function applied to DC data =0/empty?

hey there! I will try to explain my case (sorry if im not clear with the title, any suggestios are welcome)

I am setting some DCs with attributes than in the end come processed by the “generate report” tool.
Among the attributes there is one that lets call “code 1” that you can choose frrom a list like this:
Code 1: options
S0
S1
S2
S3
D

then i need a “CODE 2” That applies ONLY if you select “D” in “Code 1”
Code 2 can be writen as a text…
for example
001
002
002

So, in the end the COMPLETE CODE (CODE 1+ CODE 2) should look like this:
FOR EXAMPLE if selected
code 1: S0
code 2: nothing/empty
COMPLETE CODE : S0

but if selected D
code 1: D
code 2: 001
COMPLETE CODE : D001

i wrote complete_code: =concatenate (code_1,code_2), but of course if i write nothing or leave the value empty in code 2, it wont work.

Any ideas of how to system this?

How about this…

complete_code:
=IF(CODE 1 = D,concatenate (code_1,code_2),code_2)

1 Like

I use the option dropdown with formulas in the value section, so complete_code would have the choices,
type1: =code_1
type2: =code_1 & code_2