 # Drawing value up to a maximum

Hello I have a value of 21.945.075 and I must take the percentage to values greater than this of 12.5% this part I have already done, the problem is that when the value is greater than \$22.713.150 must set this as the maximum value and continue generating the 12. 5% on this value; that is to say if the value was \$22.713.160 or higher (\$23.000.000 …etc) any value that is higher than \$22.713.160 this should generate only the value of 12.5% on this value (\$22.713.160), can you help me to do this?

dt2.AsEnumerable.Where(Function® Integer.TryParse(r(“IBCS”).ToString.Trim, Nothing) ).Where(Function® r(“SALUD”).ToString.ToUpper.Trim.Equals(“EPS010”) And CLng(r(“IBCS”).ToString.Trim)>21945075 ).ToArray

In this way I filter only the values greater than 21945075 and multiply the value stored in this variable by 12.5%

Help please
@supermanPunch
@ppr
@NIVED_NAMBIAR

Want issue u are exactly facing here

I am not cleared with that

That when the value is higher than \$22.713.150 it must continue showing the 12.5% of \$22.713.150, that is to say if the value will reach \$23.000.000 it must give the percentage of \$22.713.150, but if this value is between values greater than \$21. 945.075 and \$22.713.150 it must generate the value corresponding to 12.5%, really my problem is when the value is higher than \$22.713.150 since I do not know how I can do so that it continues throwing me the 12.5% of this value \$22.713.150.

Like after u had filter the values based on 21945075 which include the other values which u need to manipulate

Then u can loop through each and do the following by using if condition to check it and multiply the value Accordingly

Regards

Nived N Happy Automation  It’s not very clear to me

Since u had filtered it greater than 21945075 which includes all the other values

What u need to do is

Loop through the filtered datatable using for each row and then use if condition check the whether the values are greater than. \$22.713.150 and then calculate 12.5 of the \$22.713.150 Accordingly

Regards

Nived N Happy Automation   Do this for other

Can you send a sample excel file ? @Beatriz_Eugenia_Duqu

2020.10 Planilla.xlsx (23.1 KB)