Sorting repeater on Storyteller by numeric - Encountered NaN value
Hi all.
I set a numeric sort order on a field of a repeating block. During testing I get the error: "Numeric sort with XPath 'field_name' encountered NaN value ''."
If I set the sorting as Text type it works instead.
In XMLIN I didn't initially set any function or format for that field. Even if I set the number(.) function in the Value field, however, I get the same error.
Where am I wrong?
Thanks
Best Answer
-
Numeric sorting on a repeater requires that every sort value is a valid number.
If that is not the case, you receive the above reported message.
You can try to fix your data, or change the sort key definition like this:
value[number()=number()] | default
Numeric sort turns the value into a number. In case of multiple element in node set, it takes the first value.To test if value is a valid number in XPath 1.0, AI suggests to use number() = number() condition which is false for NaN.
For default value you can use for example variable $default = 0;
Dave Bares
Product Manager1
Answers
-
Hello, can someone answer me please? thanks
0 -
@Simone Bissi , I have moved your post over to our Exstream category so that it gets the best experts to review.
1 -
Numeric sorting on a repeater requires that every sort value is a valid number.
If that is not the case, you receive the above reported message.
You can try to fix your data, or change the sort key definition like this:
value[number()=number()] | default
Numeric sort turns the value into a number. In case of multiple element in node set, it takes the first value.To test if value is a valid number in XPath 1.0, AI suggests to use number() = number() condition which is false for NaN.
For default value you can use for example variable $default = 0;
Dave Bares
Product Manager1
Categories
- All Categories
- 123 Developer Announcements
- 54 Articles
- 150 General Questions
- 148 Thrust Services
- 57 OpenText Hackathon
- 37 Developer Tools
- 20.6K Analytics
- 4.2K AppWorks
- 9K Extended ECM
- 918 Core Messaging
- 84 Digital Asset Management
- 9.4K Documentum
- 32 eDOCS
- 186 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management
- 8 XM Fax
- Follow Categories