Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

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

1 Solution

Accepted Solutions

Re: Create a text file with some hardcoded text

Hi

In else part write this

File:

Load * inline

[

Text

'No Data Received'

];


store File into File.qvd(txt);


Regards

ASHFAQ



5 Replies
Not applicable

Re: Create a text file with some hardcoded text

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

Re: Create a text file with some hardcoded text

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

Re: Create a text file with some hardcoded text

Hi

In else part write this

File:

Load * inline

[

Text

'No Data Received'

];


store File into File.qvd(txt);


Regards

ASHFAQ



Re: Create a text file with some hardcoded text

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

Re: Create a text file with some hardcoded text

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

Community Browser