FILTERXML of number value parses as datetimestamp in Excel2013

%3CLINGO-SUB%20id%3D%22lingo-sub-1313202%22%20slang%3D%22en-US%22%3EFILTERXML%20of%20number%20value%20parses%20as%20datetimestamp%20in%20Excel2013%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1313202%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20all%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EToday%20I%20decided%20to%20use%20the%20FILTERXML%20for%20a%20new%20project.%20Within%20this%20project%20I%20can%20get%20counts%20per%20car%20manufacturer%20from%20external%20XML%20source.%20WEBSERVICE%20in%20combination%20with%20FILTERXML%20would%20be%20the%20perfect%20fit%2C%20I%20thought.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20setup%20was%20done%20quite%20easy.%20After%20investigation%20the%20results%20I%20discoverd%20some%20weird%20values.%20After%20some%20investigation%20I%20found%20out%20that%20every%20number%20extracted%20via%20XPath%20between%201900%20and%209999%20is%20automatically%20parsed%20as%20datetimestamp.%20Attached%20example%20excelsheet%20(without%20calling%20external%20webservice)%20to%20show%20the%20bug.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20only%20dirty%20workaround%20I%20found%20was%20to%20adjust%20the%20call%20to%20external%20webservice.%20I%20was%20able%20to%20multiply%20the%20count%20value%20with%2010000.%20After%20the%20Xpath%20in%20Excel%20I%20divided%20the%20result%20again%20with%2010000.%20This%20works%20for%20all%20value%20except%20value%200.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20haven't%20validated%20yet%20whether%20newer%20Excel%20version%20than%20Excel2013%20still%20have%20this%20problem.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20recommended%20solutions%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1313202%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1803970%22%20slang%3D%22de-DE%22%3ESubject%3A%20FILTERXML%20of%20number%20value%20parses%20as%20datetimestamp%20in%20Excel2013%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1803970%22%20slang%3D%22de-DE%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F624764%22%20target%3D%22_blank%22%3E%40sappollo%3C%2FA%3E%26nbsp%3BI'm%20encountering%20the%20same%20behavior%20and%20bug%20in%20Excel%202016.%20Furthermore%2C%20I%20tried%20to%20utilize%20%3DNUMBERVALUE%20(%3DNUMBERWERT%20in%20German)%2C%20which%20is%20supposed%20to%20allow%20one%20to%20specify%20customized%20decimal-characters.%20However%2C%20it%20seems%20that%20%3DXMLFILTER%20(%3DXMLFILTERN%20in%20English)%20parses%20all%20numbers%20beforehand%20and%2C%20therefore%2C%20already%20interprets%20%221.8%22%20as%20the%20first%20of%20August%20and%20outputs%2044044.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20is%20a%20really%20annoying%20situation.%20For%20the%20mean%20time%2C%20I'm%20using%20the%20same%20workaround%20as%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F624764%22%20target%3D%22_blank%22%3E%40sappollo%3C%2FA%3E%20by%20multiplying%20everything%20by%2010000%20and%20only%20using%20integers%20in%20the%20XML.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1804844%22%20slang%3D%22en-US%22%3EBetreff%3A%20FILTERXML%20of%20number%20value%20parses%20as%20datetimestamp%20in%20Excel2013%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1804844%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F840772%22%20target%3D%22_blank%22%3E%40amotzek%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ECan't%20reproduce%20that%20on%20365%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Visitor

Hi all,

 

Today I decided to use the FILTERXML for a new project. Within this project I can get counts per car manufacturer from external XML source. WEBSERVICE in combination with FILTERXML would be the perfect fit, I thought.

 

The setup was done quite easy. After investigation the results I discoverd some weird values. After some investigation I found out that every number extracted via XPath between 1900 and 9999 is automatically parsed as datetimestamp. Attached example excelsheet (without calling external webservice) to show the bug.

 

The only dirty workaround I found was to adjust the call to external webservice. I was able to multiply the count value with 10000. After the Xpath in Excel I divided the result again with 10000. This works for all value except value 0.

 

I haven't validated yet whether newer Excel version than Excel2013 still have this problem.

 

Any recommended solutions?

2 Replies
Highlighted

@sappollo I'm encountering the same behaviour and bug in Excel 2016. Furthermore, I tried to utilize =NUMBERVALUE (=ZAHLENWERT in German), which is supposed to allow one to specify customized decimal-characters. However, it seems that =XMLFILTER (=XMLFILTERN in German) parses all numbers beforehand and, therefore, already interprets "1.8" as the first of August and outputs 44044.

 

This is a really annoying situation. For the mean time, I'm using the same workaround as @sappollo by multiplying everything by 10000 and only using integers in the XML.

Highlighted

@amotzek 

Can't reproduce that on 365