Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to create TXT file from variable?

Hello everybody,

my client would like to create TXT file from QlikView with number 0 or 1 (depends on if condition). I was searching for some solution, but I found nothing.

Is it possible to create only file with one of these numbers?

I tried this - but I think it is not good:

LET vNotification_file#1=if( if( InWeek(Today(),date(if( $(vActualDate)<= $(vActualDate2), vActualDate2, vActualDate)),0),

date(date(if( $(vActualDate)<= $(vActualDate2), vActualDate2, vActualDate)))=today(),

  date(date(if( $(vActualDate)<= $(vActualDate2), vActualDate2, vActualDate))+2)=today()),

'0 ','1 ');

- then I manually created empty TXT file

Tab1:

LOAD @1 as not1,

$(vNotification_file#1)

from

$(vPathDATA)not.txt

(txt, codepage is 1250, no labels, delimiter is '\t', msq);

Tab2:

LOAD

$(vNotification_file#1)

Resident Tab1;

Store Tab2 into $(vPathDATA)Notification_file#1.txt(txt);

This gives me number 1 in TXT file.

Many thanks.

Maros

10 Replies
carlcimino
Creator II
Creator II

Thanks Marcus. I have it working now. The main problem was the lack of quotes!  So silly of me.  Appreciate your reminding me of that detail.

execute cmd.exe /c echo. > "$(vDataPath)BAR_FILE_IND.txt";