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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Create a text file with some hardcoded text

Is it possible to create a text file with some message in it such as 'No Data Received' and store it at some location?

When some codition fails then in the else part i want a text file to be created with this message

Labels (1)
1 Solution

Accepted Solutions
ashfaq_haseeb
Champion III
Champion III

Hi

In else part write this

File:

Load * inline

[

Text

'No Data Received'

];


store File into File.qvd(txt);


Regards

ASHFAQ



View solution in original post

5 Replies
Not applicable
Author

Hi Asma,

yes you can use execute cmd lines to write files to certain locations like that, or out as an email rather than a txt file for example

Anonymous
Not applicable
Author

Yup.  Create a table with an InLine load and store it in txt format, as opposed to qvd format.

ashfaq_haseeb
Champion III
Champion III

Hi

In else part write this

File:

Load * inline

[

Text

'No Data Received'

];


store File into File.qvd(txt);


Regards

ASHFAQ



its_anandrjs
Champion III
Champion III

Hi Asma,

Yes it is possible try this code

Tab://Suppose it is table with zero rows

LOAD * Inline

[

Name

];

LET vNoOfRow = NoOfRows('Tab');

If $(vNoOfRow) = 0 Then

Status:

LOAD * Inline

[

No Data Received

];

STORE Status into Status.txt(txt);

ENDIF;

Note:- and in second reload put some values and try to reload you not get any field generated

Regards

Anand

its_anandrjs
Champion III
Champion III

Hi Asma,

You can load your table like below script to get the current date and time also

Tab:

LOAD * Inline

[

Name

];

LET vNoOfRow = NoOfRows('Tab');

If $(vNoOfRow) = 0 Then

Status:

LOAD

'No Data Received on '&Now() as Status

AutoGenerate 1;

STORE Status into Status.txt(txt);

ENDIF;



Regards

Anand