Skip to main content
Announcements
Meet the 2024 Qlik Luminaries and Partner Ambassadors! READ ON!
cancel
Showing results for 
Search instead for 
Did you mean: 
mee-qlik
Partner - Contributor
Partner - Contributor

How to load only a section of .csv file

Hi,

my goal is to load a "," delimited file ( see test file attached ) removing the first line "Summary" , reading the file then removing the "Daily Usage" section

It's possible?

Thank you

Enrico

1 Solution

Accepted Solutions
m_woolf
Master II
Master II

6 Replies
marcus_sommer

You could try something like this:

First 1 LOAD * FROM [..\Test_partial_read.csv]

(txt, utf8, embedded labels, delimiter is ',', header is 4 lines);

- Marcus

m_woolf
Master II
Master II

sample qvw is attached.

FindDailyUsage:

LOAD

  rowno() as LineNo,

  PartnerId

FROM

(txt, utf8, embedded labels, delimiter is ',', msq, header is 4 lines);

Temp:

load

  LineNo

resident FindDailyUsage

where PartnerId = 'Daily Usage';

let vFirst = peek('LineNo');

drop Tables FindDailyUsage,Temp;

First $(vFirst)-1

LOAD

  rowno() as LineNo,

  PartnerId,

    PartnerName,

    PartnerBillableAccountId,

    CustomerCompanyName,

    MpnId,

    InvoiceNumber,

    ChargeStartDate,

    ChargeEndDate,

    SubscriptionId,

    SubscriptionName,

    SubscriptionDescription,

    OrderId,

    ServiceName,

    ServiceType,

    ResourceGuid,

    ResourceName,

    Region,

    Sku,

    DetailLineItemId,

    ConsumedQuantity,

    IncludedQuantity,

    OverageQuantity,

    ListPrice,

    PretaxCharges,

    TaxAmount,

    PostTaxTotal,

    Currency,

    PretaxEffectiveRate,

    PostTaxEffectiveRate,

    ChargeType,

    CustomerId,

    DomainName

FROM

(txt, utf8, embedded labels, delimiter is ',', msq, header is 4 lines);

mee-qlik
Partner - Contributor
Partner - Contributor
Author

It works! Thank you!

But ...

There is a complication. This is a test file, but in production I' have a directory with a lot of similar file , with a section of "summary" that I'have to read and a section of "daily" that I' have not to read.

My goal is to read the files stored in the directory (all) and load in QlikView only the section "summary" of every file.

I' don't know the name of every file, only the directory.

To test, I attach 3 file

Thank's again

Enrico

m_woolf
Master II
Master II

Try this:

mee-qlik
Partner - Contributor
Partner - Contributor
Author

Great!

Thank you again

Enrico

mee-qlik
Partner - Contributor
Partner - Contributor
Author

Now, another question, if you can help me.

In the same test situation, my customer ask me to read the section "daily usage" to ceck the total value in the section "summary".

So I can show a section "detail" of the summary.

Thank you

Enrico