Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to load only some data from an excel file

LOAD

    FY.YEAR as "FY",

//     "MONTH" as "Month",

  MonthName("Begin of Month") as Month,

    Quarter as Quarter,

FROM [lib://Desktop/Tequila & Cream H1 2014-15.xlsx]

(ooxml, embedded labels, table is Sheet1);

WHERE Match(FY.YEAR,'2013-14');

I have a file with a lot to data. I only want data relating to FY 2013-14. Its stored as a text field in the excel sheet. I tried using FY instead of FY.YEAR, but that didn't work either.

1 Solution

Accepted Solutions
Not applicable
Author

I would say the issue is your Script has wrong ; before the Where Statement, this should work

LOAD

    FY.YEAR as "FY",

//     "MONTH" as "Month",

  MonthName("Begin of Month") as Month,

    Quarter as Quarter,

FROM [lib://Desktop/Tequila & Cream H1 2014-15.xlsx]

(ooxml, embedded labels, table is Sheet1)

WHERE Match(FY.YEAR,'2013-14');

View solution in original post

3 Replies
Not applicable
Author

I would say the issue is your Script has wrong ; before the Where Statement, this should work

LOAD

    FY.YEAR as "FY",

//     "MONTH" as "Month",

  MonthName("Begin of Month") as Month,

    Quarter as Quarter,

FROM [lib://Desktop/Tequila & Cream H1 2014-15.xlsx]

(ooxml, embedded labels, table is Sheet1)

WHERE Match(FY.YEAR,'2013-14');

Not applicable
Author

Daniel is right, you can also try the below approach as well using Exists function:

filter:

LOAD * INLINE [
Year
2012
2014
]
;


test:

LOAD

    FY.YEAR as Year,

//     "MONTH" as "Month",

  MonthName("Begin of Month") as Month,

    Quarter as Quarter,

FROM [lib://Desktop/Tequila & Cream H1 2014-15.xlsx]

(ooxml, embedded labels, table is Sheet1)

where Exists(Year);

Thanks,

Angad


Anonymous
Not applicable
Author

Thanks. Silly error. Rahul