Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
smilingjohn
Specialist
Specialist

Script

Hi All ,

I have to achieve a condition in the edit script ..which is like below

if year is less than Today then it has to executive a table

Load

Year

Mnth

office

Dept,

.from /..........qvd

else

the other table has to be executed

year

Dept

Sect

. from /....qvd

can someone help me in writing this  in the edit script


Thanks in Advance

5 Replies
micheledenardi
Specialist II
Specialist II

Hi John,

The first table have only one row ?

Have we to check the first/last row of the first table to check the condition ?

Michele De Nardi
If a post helps to resolve your issue, please accept it as a Solution.
smilingjohn
Specialist
Specialist
Author

Hi Michele De Nardi

The requirement is like

If the Year is <  than today then it has to executive the table called " Income Tax"  else it has to Executive the the table

"Funds" i only tried to show u the sample example by taking fields

What iam trying to do is like this

IF year<= Today

Load

Year

Month

Incometax

travel

FROM

Else


Load

Year

Dept

Fund

Salary

I hope you are clear now

Not applicable

first load both qvds in table A and B.

Then u can try something like this.

load *,

if( year<=year(Today()),office,dept resident A.qvd,

year,Dept,Sect resident B.qvd);

Regards

Khushboo

micheledenardi
Specialist II
Specialist II

Yes,

but we have to evalue the "if" statement (IncomeTax.Year < Year(today())) for each row of IncomeTax table ?


Could be something like that ?


IncomeTax:

LOAD Year,

     Mnth,

     office,

     Dept

FROM IncomeTax.xlsx (ooxml, embedded labels, table is Sheet1);

Let vYear=peek('Year',0,'IncomeTax');

drop Table IncomeTax;

if vYear<year(today()) then

      IncomeTax:

      load *

      FROM IncomeTax.xlsx (ooxml, embedded labels, table is Sheet1);

ELSE

     Funds:

      load *

      FROM Funds.xlsx (ooxml, embedded labels, table is Sheet1);

end if

Michele De Nardi
If a post helps to resolve your issue, please accept it as a Solution.
vinieme12
Champion III
Champion III

Can you clarify what exactly is the YEAR? is it a field from any of the tables?

can you post some dummy data to explain what you want to achieve

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.