Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
18 replies
Subscribers
7 subscribers
Views
4370 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
We are using MS SQL Server and for one of a column(SharePercent), we have below
Mahesh Sanga
over 8 years ago
We are using MS SQL Server and for one of a column(SharePercent), we have below definition in our CDT.
<xsd:element name="SharePercent" nillable="true" type="xsd:decimal">
<xsd:annotation>
<xsd:appinfo source="appian.jpa">
@Column(name=SharePercent columnDefinition="Decimal(15,12)")
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
In the underlying table we have column SharePercent definition as "SharePercent(decimal(15,12), not null)" and we have below values for this column
50.508771927000
19.442982457250
19.442982457250
10.605263158500
We have created a query rule to return these values but the values are being rounded up to 5/6 so, the query rule is returning below values.
50.50877
19.44298
19.44298
10.60526
Should we change the CDT definition to return all decimal values?
OriginalPostID-163295
OriginalPostID-163295
Discussion posts and replies are publicly visible
0
vinitl522
A Score Level 2
over 8 years ago
Try using Double instead of decimal, in below XSD snippet and verify:
<xsd:element name="SharePercent" nillable="true" type="xsd:double">
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Mahesh Sanga
over 8 years ago
Hi Vinit, It didn't work. The decimal values are still rounded up.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Mahesh Sanga
over 8 years ago
I have tried changing the definition as below but still the values are being rounded up.
<xsd:appinfo source="appian.jpa">@Column(name=SharePercent, precision=10, scale=15, columnDefinition="Decimal")</xsd:appinfo>
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
vinitl522
A Score Level 2
over 8 years ago
What is the returned values you are seeing
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sagarl511
A Score Level 2
over 8 years ago
Maximum precision in Appian is of 21. Check link -
forum.appian.com/.../Custom_Data_Types_from_XSD.html
Try for - SharePercent(decimal(9,12), not null). It should solve your problem.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Mahesh Sanga
over 8 years ago
@vinit I am seeing same values, no change.
@Sagar, Tried your solution, the query rule is returning same values with my existing view. I am creating a dummy table to test your solution.
Thanks
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sonalk
over 8 years ago
Hi Mahesh,
Tried with the similar inputs
Specifications in XSD is as below:
<xsd:element name="a" nillable="true" type="xsd:double" />
Table column is specified as
DECIMAL(18,12)
It seems to work.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Mahesh Sanga
over 8 years ago
Hi Sonal, did you try on MS SQL server?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sonalk
over 8 years ago
Tired it on MySQL.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sonalk
over 8 years ago
Please check if these links can be useful :
msdn.microsoft.com/.../ms187746(v=SQL.90).aspx
stackoverflow.com/.../what-is-the-maximum-precision-with-decimal-in-sql-server-2005
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
>