Hi
In my source file one column is defined like this
Input:
Column1
1,111
0,8889
0,75
please note :its a comma in between not the dot in source input
When i am reading this in Alteryx the datatype is Double and this comma changes to dot . So it becomes like this
Column1
1.111
0.8889
0.75
My requirement is
IF column1 is greater than or equal to 1 then it round up to 1
For eg: 1,111 will become 1,00
Similarly if column1 is less than or equal to 0 then it should print this way
0,75 will become 0,75
0,8889 will become 0,89
Can you please suggest the solution
Regards
Areeba
Solved! Go to Solution.
Hi @areeba
I think this does what you want,
I change the float to a string with commas and at the right dp. See attached.
Thanks,
Phil
Thank you for the solution it is exactly i have been looking for.
There are two things
1) if value is 1 or greater than 1 for eg here its 1.1111 then also it should also print 1,00 .As for now it is just showing 1 in output.
for eg:
Column1 Output
1 1,00
1.1111 1,00
2) Also , like i mentioned as per my requirement i need to show Column1 also in my output with Comma not the Dot. Originally it is a comma in the source file but when i am loading the source file that comma becomes a dot.
For eg in Alteryx it is looking like this :
Input
Column1
1.1111
1
0.75
0.8889
Output which i want including Columnn1
Output
Column1 Output
1,1111 1,00
1 1,00
0,75 0,75
0.8889 0,89
I hope i am clear 🙁
Thanks
Areeba
Thank you for the solution but I have a little change in formula .
its like
IF [column1)>1 then 1.00
elseif [column1]<0.1 then 1.00
else column1
its not comma now , its simple dot .
Can you suggest ?
Regards
Areeba
Hi @areeba
Is this what you are looking for
Output:
Formula
if [Column1] > 1 then "1.00"
elseif [Column1] <0.1 then "1.00"
else ToString([Column1], 2, 1)
endif
Check and let me know
hi @atcodedog05
Expected Output:
Column1 Output
1 1.00
1.1111 1.00
0.75 0.75
0.8889 0.88
0.0278 1.00
the idea is that if column 1 is greater than 1 then it should print 1.00, if column 1 is less than 0.1 then 1.00 otherwise it picks the actual value of column 1
As per your solution for the value 1 it is coming 1 in output not 1.00 and rest i have explained above.
Hi @areeba
I checked with your new input i seem to be getting expected output
Please do check and let me know🙂
Yes this is correct , only one thing is if it is 0.8889 then we should pick actual value not rounded values as it is neither greater than 1 nor less than 0.1. we need to pick actual value as it is.
0.8889 ---> 0.88