Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Store Variable (only) to text file? (for cURL XML Query)

Hi Everyone,

I might repost this with a more holistic subject line, but here's my immediate question and then what I'm trying to do:

Is it possible to write out a headerless text file from a variable?

Inline loads STORE'd to a text file contain a header.  And the header has a character limit, so I can't just put my variable on the header line.

Overall, I'm trying to interface with a cloud service that has a picky Web-based API.  So, I'm using cURL to pass in an XML query.  To the best of my knowledge, the XML query is too big to pass directly into the cURL command line I'm using, so I'm passing it through a file.  This works fine.  But, the API only recognizes a one-line XML query (same query, just without the nice linefeeds and indentions), hence the reason I can't use a text file with a header.

The next hurdle is that the cloud service has a 1000-row limit, which is not a huge problem, because I can specify my row range in the XML query.  Currently, I would need to overestimate the number of rows coming back, and have a query set up for each potential 1000-row blocks of results.  But, this is inefficient and sloppy.

Ideally, it would be awesome if I could increment the row range in QlikView, populate out an incremented query to the XML query text file and then re-run the cURL command.  That way, I could have QV watch the result sets coming back, and if they're a full 1000 rows, it'll increment and request the next 1000, or quit if there are fewer than 1000, indicating the end of the table.  But, this requires being able to dynamically generate the XML query in QV and write it out to a single-line text file, for cURL to pick up.

Any ideas?



Community Browser