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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to load data for only Year 2011

Hello Guys:

Could someone please advise me how to limit the load data into Qlikview?

For Example: I would only like to load all the data for Year 2011 and not those data that as from Year 2007 to 2011.

The database starts from 2007 to 2011.

Thank you guys.

15 Replies
Not applicable
Author

Hi

You can limit your load with

select column

from table

where year = 2011

or similar in your load statement

its_anandrjs
Champion III
Champion III

Hi,

You can write some thing like this

Load

Field1,

Field2,

...

...

From TableName

Where Year>=2010 and Year<=2011;

Regards

Anand

sushil353
Master II
Master II

Hi,

sql select * from table-X where year > 2010 and year <=2011;

Not applicable
Author

Hi Sushil Kumar:

Thanks for your reply.

Do I write this in the Edit script Main Tab or in the first tab?

I have three table for the report so do I need to write all in the different tab under Edit script?

I will just try it.

Thanks for your reply

Miguel_Angel_Baeyens

Hi,

It's all in the script, your table should look like the following

Table: // name of the table in QlikView

LOAD ID, // name of fields in QlikView (you can change them)

     Date,

     Amount;

SQL SELECT ID, Date, Amount

FROM Database.SalesTable

WHERE Year = 2011;

Hope that helps.

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica

sushil353
Master II
Master II

Hi richardgan,

It hardly matters whether you write in a single tab or in multitab... Multitab is prferred for clear understanding...

HTH

christian77
Partner - Specialist
Partner - Specialist

Make it dynamic, for further years.

where year = year(today())

Not applicable
Author

Hi Guys:

Thank you all for your kind help.

I try the sugesstion and the error message is:-

Unknown statement Where Year>=2010 and Year<=2011;

The other Error message is:-

Unknown Statement Where Year =2011

Below is the Edit script:

tbinventorytrans:

Load InventoryKey1,

            InventoryDate,

            Year(InventoryDate) as Inventoryyear1,

            Year (InventoryDate) as year, //=====Checking

            num(month(InventoryDate)) as month,//==== Checking

            num(Month(InventoryDate),'00') as Inventorymonth1,

            Year(InventoryDate) &  num(Month(InventoryDate)) as InventoryYearMonth1,

            Day(InventoryDate) as Inventoryday1,

            date(daystart(InventoryDate),'DD-MM-YYYY') as InventoryDate1,

            InventoryStatus,

            InventoryGoodqty,

            InventoryBadqty,

            InventoryQcqty,

            prodid,

            custacc,

    invtype,

    locid

FROM (qvd);// where $(CurrYr) >=#[Inventoryyear1];

where year >=2011 and year<=2011;

sushil353
Master II
Master II

Hi

check out which field of your table contains the year information.. then use that field to apply the condition.