Quantcast
Channel: SCN : Unanswered Discussions - SAP Crystal Reports
Viewing all articles
Browse latest Browse all 4814

Compare and Pick values from Array In Crystal Report

$
0
0

I need a help in formula,

I've a data in form of concatenated string like :

1.0000 - 50000000.0000 : 1.25 | 50000001.00000 - 150000000.00000 : 3.00

these are slabs (From - To) and Fee% in different forms. Sometimes they are in singular form some times multiple.

e.g Singular : 1.0000 - 50000000.0000 : 1.25

Here Slab From - To is 1.0000 - 50000000.0000 and Fee% is 1.25

e.g Multiple : 1.0000 - 50000000.0000 : 1.25 | 50000001.00000 - 150000000.00000 : 3.00

Here Slab From1 - To1 is 1.0000 - 50000000.0000 and Fee1% is 1.25 and

Slab From2 - To2 is 50000001.00000 - 150000000.00000 and Fee2% is 3.00

and so on

Now problem is  want to compare these From - To slabs with another field. In Case of Multiple Slabs if it lies between first slab then I want its Fee1%

Else if it lies between second slab then I want Fee2%.

I've splitted these strings using array and printing these strings :

formula to split and print slab from:

local stringvar s := {ds_MngFeeComm.MANGE_FEESLAB};

 

local stringvar s1 := Replace(Replace(Replace(s,'-','-'&CHR(13)),'|',CHR(13)),':',':'&CHR(13));

 

local stringvar array s2 := split(s1, chr(13));

 

local numbervar i;

 

for i := 1 to ubound(s2) do

 

(

 

  if instr(s2[i],'-') > 0 then

 

  local stringvar from := from + s2[i] + chr(13);

 

);

 

Replace(from,'-','');

Values.jpg

But how to compare and pick Fee% is the actual problem because I've to use this Fee% in calculations.

 

Any help would be highly appreciated.


Viewing all articles
Browse latest Browse all 4814

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>