Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Converting weird decimal to string in a cross tab Post Reply Post New Topic
Author Message
BSquare
Newbie
Newbie
Avatar

Joined: 05 Jul 2012
Location: United States
Online Status: Offline
Posts: 5
Quote BSquare Replybullet Topic: Converting weird decimal to string in a cross tab
    Posted: 16 Jul 2012 at 1:58pm
I am working on an already existing report that was built by someone no longer with the company. He built a cross tab and the data he is pulling is being converted to 0's and 1's and then created a legend to help correlate. What I want to do is possibly use a formula to convert these behind the scenes instead of using a confusing legend. I was thinking in the Cross Tab Group Options (it's a row of grouped items) to use a formula as group name. I just need help on the formula, I'm still really new! So what I have is
 
0.001.001.00 = Medicare and Medicaid
1.000.000.00 = CICP
1.000.001.00 = CICP and Medicaid
1.001.000.00 = CICP and Medicare.
 
I've tried searching everything I can think of and cant come up with a formula that works. Is this even possible? If not, is there a way that I can at least shorten the numbers down, because per the legend it should be 011 = Medicare and Medicaid, 100 = CICP so on and so forth. Any advise would be greatly appreciated by this newbie!
 
Thanks!
Kristin
EHR Application Specialist
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 18 Jul 2012 at 3:24am
well, this is what comes to mind...
shared stringvar array x = split({table.field}, ".")
local numbervar z;
local stringvar result := "";  //initializing is probably overkill
for z = 1 to 3 (
  result = result + totext(val(x[z]), "", 0);
);
 
result
 
 
my syntax might be off, check with help in CR, but this should give 011, 100, 101.
 
Since CR is Basicish  the index starts at 1, if it was more Cish it would start at 0.  I only used the first 3 digits as it appears from the example that the last section .00 is never used.
 
HTH
 
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.