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
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

Try this,

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 year(InventoryDate) = '2011';

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Hi,

Check thename of your date field and put that in "WHERE" clause

-Jai

its_anandrjs
Champion III
Champion III

Hi,

You need to put some think like this

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 Year(Today()) >=[Inventoryyear1];

Regards,

Anand

christian77
Partner - Specialist
Partner - Specialist

Hi:

Where Year(Today()) >=[Inventoryyear1]; NO!!!

WHERE year(InventoryDate) = year(today());

1º It must be the original field   InventoryDate

2º The field InventoryDate must have a date format in order to extract the year correctly.

3º Even when it should be the same, I place the field first, then equal sign, then the variable, criteria, etc.

Ok.

its_anandrjs
Champion III
Champion III

Hi,

You need to put some think like this

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  [Inventoryyear1] >= Year(Today());

It works or not if not let me know

Regards,

Anand

Miguel_Angel_Baeyens

Yep, you need to check your syntax

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 Year(InventoryDate) = Year(Today());

Hope that makes sense.

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica