Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Macro wrongly converting decimal seperator

Hamder83
11 - Bolide

Hi 

Im using an alteryx xlsx to csv converter, which converts , to . in the output.

Any way to change this ?

Using this macro 


kind regards

10 REPLIES 10
DavidP
17 - Castor
17 - Castor

could you provide an input file for the macro?

Hamder83
11 - Bolide

Hi 

Here is a copy of my input file 🙂 

DavidP
17 - Castor
17 - Castor

Hi @Hamder83, thanks for providing the input file.

 

I've had a look through the macro and what it's doing, but I can't really figure out what you want help with 🙂

 

Could you specifically show me or explain what the problem is you want us to look at?

 

Is this your macro or someone else's?

Hamder83
11 - Bolide

Hi David 

Thanks for your reply, 

im from Denmark - we use , as decimal seperator and . as thousand seperator.

The input file has this format. But the csv file that the macro outputs has . as decimal seperator.

And I just wanna keep the format from the input file.


Its a macro ive downloaded 

vishnuharinarayanan
7 - Meteor

Hi,

 

Do you need the output file to be like shown below:

 

vishnuharinarayanan_1-1589191021665.png

 

If so, can you please use Multi Field Formula tool , and replace the "." with "," using the expression as shown below:

 

vishnuharinarayanan_2-1589191151286.png

 

Please make sure to convert the Input fields into String datatype before applying the formula.

 

Please let me know if it works.

 

 

 

 

 

 

DavidP
17 - Castor
17 - Castor

I think one of the problems here is, if there are commas (,) in your data and you write it to a CSV that uses comma as a separator, it will mess up the structure of your data.

 

I looked at the file and what the macro does and I think it's probably easier just to build the workflow from scratch without the macro. It seems that there is a structure in the Excel file that we can rely on, so have a look at the attached workflow and let me know if it works for you.

 

I've changed the CSV delimiter to a pipe (|) rather than a comma, but this can easily be changed in the Output data tool if you like, as long as it's not a comma.

 

DavidP_0-1589191603891.png

 

Hamder83
11 - Bolide

Hi David 

Thanks for the effort, 

Though, if I run your workflow I still get the csv with dot's? 

Hamder83_0-1589193916874.png


Am i doing anything wrong ? 

I tried with the macro to change the delmmiter to something different, but it still does not work.

 

DavidP
17 - Castor
17 - Castor

The dots are in the input file as shown below when read with an Input Data tool. In your earlier post you mentioned that you want to write the data in the same format as the input file.

 

DavidP_0-1589196358873.png

 

Am I correct then in saying that in these fields, the dot represents a decimal

 

GrundprisSMS - serviceMiljøtillægI alt (excl. moms)
63.5501.2764.82
30.400.6131.01
32.0700.6432.71
32.0700.6432.71
32.0700.6432.71
32.0700.6432.71

 

but in these fields the dots represent a thousand separator

 

VægtVolumenvægtFaktureret vægt
4.60033.37033.370
1.7503.7763.776
1.5005.7005.700
1.5405.4005.400
2.8007.3757.375
0.5006.0546.054

 

If so, you can use the multi-field formula as suggested by @vishnuharinarayanan 

 

Updated workflow attached.

Hamder83
11 - Bolide

Hi again

And thanks for the effort, again! 🙂 

My input data has comma as decimal seperator both in price and weight.

Hamder83_0-1589274966132.png


So prefferably it should just keep the format of the input file?

Nor price or weight has a thousand seperator, its weight(vægt9 in kilo so its 33,370 kg? 🙂

Labels