Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
mhmmd_srf
Creator II
Creator II

Where 1 in script

Hi All,

I am using a script like :

Temp1:

Load

A as aa,

B as bb

resident Temp_Table

where 0;

It truncating data from table. If I check data in Temp1, it is showing 0 records.

If I put where 1, then it is showing all records.

Is it something line where 1 means it will show first row only?

Please help me to understand the logic.

Thanks,

Sarif

8 Replies
its_anandrjs

Use First or RowNo() functions.

its_anandrjs

Try this way for your script

1. By First

First 1

Noconcatenate

Temp1:

Load

A as aa,

B as bb

resident Temp_Table;

2. By Rowno()

Noconcatenate

Temp1:

Load

A as aa,

B as bb

resident Temp_Table

Where RowNo() < 1;


This all loading only one row.

PrashantSangle

Hi,

1 means true. and

0 means false

to take read only 1 record you can use like

select top 1 * from tableNAme

or

First 1 Load * from tableNAme

navigate below thread

First ‒ QlikView

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
mhmmd_srf
Creator II
Creator II
Author

Hi,

I want to understand what is the difference between where 0 and where 1.

its_anandrjs

Where 0 means False value is passed to the Load statement and when using Where 1 it passes True to the load statement. I believe that is the only difference.

mhmmd_srf
Creator II
Creator II
Author

I am not very clear.

Could you please explain with my example.

Thanks in advance for your co operation.

Sarif

sasiparupudi1
Master III
Master III

It is like using  where 1=1

or where 1=0 in sql


Temp1:

Load

A as aa,

B as bb

resident Temp_Table

where 0;

is same as

Temp1:

Load

A as aa,

B as bb

resident Temp_Table

where 1=0;

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

The Where clause determines if the current input row will be included in the output table. If Where returns a true value, the row will be kept, if false the row will be discarded.

Where 0;  // Always false, keep no rows

Where 1;  // Always true, keep all rows

-Rob