Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
griffin2571
Contributor
Contributor

How to remove decimal in Data Field

I Have this in the data load editor for the parts order field. Left([Parts Order],Len([Parts Order])-1)&'.'&Right([Parts Order],1) As "Parts_Dec".

 

It obtained the result I wanted with data that had suffix "Parts +". However I have some data that do not meet that criteria. What would be the best way to keep the decimals in place for Parts order that start with "Parts +" but remove decimals that have all numbers.

Example - 2022307160.1 converts to  20223071601

PARTS +840.0 stays the same

griffin2571_0-1667573203031.png

 

Labels (5)
1 Solution

Accepted Solutions
MarcoWedel

I guess it's better to not insert the unnecessary decimal points in the first place, instead of deleting them afterwards:

 

If([Parts Order] like 'PARTS +*',Left([Parts Order],Len([Parts Order])-1)&'.'&Right([Parts Order],1),[Parts Order]) as Parts_Dec

 

View solution in original post

2 Replies
BrunPierre
Partner - Master
Partner - Master

Perhaps

If(SubStringCount([Parts Order],'PARTS +')=0,Replace(Field,'.',''),[Parts Order])

MarcoWedel

I guess it's better to not insert the unnecessary decimal points in the first place, instead of deleting them afterwards:

 

If([Parts Order] like 'PARTS +*',Left([Parts Order],Len([Parts Order])-1)&'.'&Right([Parts Order],1),[Parts Order]) as Parts_Dec