Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

prabhu_rutali
New Contributor

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

5 Replies
OmarBenSalem
Esteemed Contributor

Re: if condition in scripting

Maybe sthing like this :

//Suppose this is your current table

ftm:

load * inline [

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:

Capture.PNG

prabhu_rutali
New Contributor

Re: if condition in scripting

Ty omar.

OmarBenSalem
Esteemed Contributor

Re: if condition in scripting

That did the trick?

prabhu_rutali
New Contributor

Re: if condition in scripting

yes

OmarBenSalem
Esteemed Contributor

Re: if condition in scripting

Good.

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

Community Browser