Need to round off number based on condition
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi
I want to round off based on first decimal place only following the logic below :-
0.1 and 0.2 = 0.0
0.3 and 0.4 = 0.5
0.6 and 0.7 = 0.5
0.8 and 0.9 = 1.0
How can we do this please help
Thank you
Solved! Go to Solution.
- Labels:
- Workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @sgaryali
If your range of values is always between 0 and 1, you can use a formula like this one, just use the proper intervals:
IF [Number]>=0.1 AND [Number]<=0.2 THEN 0.0
ELSEIF [Number]>=0.3 AND [Number]<=0.4 THEN 0.5
ELSEIF [Number]>=0.6 AND [Number]<=0.7 THEN 0.5
ELSE 1.0 ENDIF
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
If the condition isn't dynamic, this works :)
Happy Alteryxing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@sgaryali , If your condition is specific to some values then please use IF ELSE ladder in formula tool else you can use the solution provided by @Carlithian, in case you are following a criteria and the condition is not dynamic corresponding to input.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @sgaryali
Yes as per your requirement, it is possible to round-off.
1. Used the select tool to convert the number to string
2. Parse is used to split whole number and decimals
3. Formula to based on your condition
4. Sum both whole number and output
5. Displaying the result
 
 
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @sgaryali
My Alteryx version is outdated and I couldn't save the workflow.
Have attached the tool in step by step, can you please replicate.
 
  
 
 
