5 Replies Latest reply: Jun 6, 2017 3:20 AM by omar bensalem

# if condition in scripting

If there is a field name  (period_num) having months  1 to 13 & there is another field(ftm). According to the requirement I want to consider till (period_num)=12, such that ftm of period_num=13 is added in ftm of period_num =12

• ###### Re: if condition in scripting

Maybe sthing like this :

//Suppose this is your current table

ftm:

num,ftm

1,10

2,20

3,30

4,40

5,50

6,60

7,70

8,80

9,90

10,100

11,110

12,120

13,130

];

//what you should do

newFtm:

NoConcatenate

load num,sum(ftm) as FTM group by num ;

load num, ftm Resident ftm where num<>12 and num<>13;

Concatenate

load num, sum(ftm) as FTM group by num;

load '12' as num, (ftm) Resident ftm where num=12 or num=13;

drop table ftm;

result:

• ###### Re: if condition in scripting

Ty omar.

• ###### Re: if condition in scripting

That did the trick?

• ###### Re: if condition in scripting

yes

• ###### Re: if condition in scripting

Good.

Then please, don't forget to close the thred by marking the correct answer as correct.