Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Signed short hexadecimal

myousuff81
7 - Meteor

Hi,

 

Need help to convert Signed short hexadecimal to decimal

 

 

For example FD80 should be converted to decimal value -640.  Can you please provide Alteryx solution for this in the formula tool?

2 REPLIES 2
JoeL
Alteryx Alumni (Retired)

Hi @myousuff81 ,

 

This should work as long as there is 1 hexadecimal per-row in the column. Can handle any size Hexidecimal!

 

 

if HexToNumber([HexField]) > HexToNumber(PadRight('8', length([HexField]),'0')) then

-2*HexToNumber(PadRight('8', length([HexField]),'0')) + HexToNumber([HexField]) else

HexToNumber([HexField]) endif

//PadRight('8', length([HexField]),'0') = negative crossover point

// -(negative crossover point as integer) - (subtracting negative crossover from original Hex) + (original hex)
// = -2(neg. crossover point as int) + (original hex as int)
// Joe L

 

 

Hexidecimal Formula.png

 
myousuff81
7 - Meteor

Thanks Joel. It works perfectly.

Labels
Top Solution Authors