How to keep leading zeros in data export and when combining fields | XM Community
Skip to main content

Hi everyone!

Using custom validation (matches regex ^[0-9]{2}$ ) I make sure that my participants always enter two digits in response to a question, i.e. "08" must be entered instead of "8".
However, in data export and when concatenating variables, “8” still shows up as “8” even though “08” was entered.
 
However, I would also like to export (e.g. to csv or excel) this result as "08" not as "8".
Moreover, I would like to concatenate combined variables in the data section and here "08" should be also used instead of "8".
 
Is this possible?
 
Thanks.
 
Best

Hi,
I'm not sure how to force the export to keep 0's in, other than potentially capturing them as embedded data and putting a ' at the beginning.
Alternatively in Excel if you're trying to concatenate them then you can use the below formula to make 8 concatenate as 08.
TEXT(A1,"00")
Assuming value 8 was in cell A1. This result is 08.
So you can concatenate like this:
=CONCATENATE(TEXT(A1,"00"),TEXT(B1,"00"))
Hope this helps!
Steph


Leave a Reply