Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

priyarane
Contributor III

hide some script in log

Hi Community,

Is there any way hide script in logs.

we are have set error mode=0 and set error mode=1, in between 0 and 1 we are using drop field statement at the end of script, we are finding field not found and which can be ignored that QV developers know but my production support team saying some error we found. so I need to hide that part.

Is there any way?

-Priya

1 Solution

Accepted Solutions
flipside
Valued Contributor II

Re: hide some script in log

Yes, just wrap a loop around it, like this ...

For each field in 'Data','Data2','Data4'
If FieldValueCount('$(field)')>=0 then
Drop Field $(field);
EndIf;
Next field;

flipside

EDIT: You might find it easier to store the desired fields to drop in a list as in this example ...

FieldsToDrop: //Note: it is dropping itself in the list!
Load
chr(39) & concat(FieldToDrop,chr(39) & ',' & chr(39)) & chr(39) as FieldToDrop
inline [
FieldToDrop
Data
Data2
Data4
FieldToDrop
]
;

let vFieldsToDrop = peek('FieldToDrop');

For each field in $(vFieldsToDrop)
If FieldValueCount('$(field)')>=0 then
Drop Field $(field);
EndIf;
Next field;

7 Replies
sergio0592
Valued Contributor II

Re: hide some script in log

You can make hidden script. He is invisible in the reload log file.

https://help.qlik.com/en-US/qlikview/12.1/Subsystems/Client/Content/Hidden_Script.htm

flipside
Valued Contributor II

Re: hide some script in log

You need to wrap a test around the DROP command ...

If NoOfRows('Test') >=0 then
Drop Table Test;
EndIf;

flipside

priyarane
Contributor III

Re: hide some script in log

this hidden script will come first but my script at last of script

priyarane
Contributor III

Re: hide some script in log

Hi Dave, can you pls elaborate pls.

flipside
Valued Contributor II

Re: hide some script in log

Apologies, I put code up for testing a table rather than a field. In that case use this code ...

If FieldValueCount('Data')>=0 then
Drop Field Data;
EndIf;

This will test for the existence of the field before running the DROP command and generating the error message.

flipside

priyarane
Contributor III

Re: hide some script in log

Thanks Dave, it can work for one field, but I have fields more than 50 columns. Can you pls share your ideas if you have.

-Thank you

flipside
Valued Contributor II

Re: hide some script in log

Yes, just wrap a loop around it, like this ...

For each field in 'Data','Data2','Data4'
If FieldValueCount('$(field)')>=0 then
Drop Field $(field);
EndIf;
Next field;

flipside

EDIT: You might find it easier to store the desired fields to drop in a list as in this example ...

FieldsToDrop: //Note: it is dropping itself in the list!
Load
chr(39) & concat(FieldToDrop,chr(39) & ',' & chr(39)) & chr(39) as FieldToDrop
inline [
FieldToDrop
Data
Data2
Data4
FieldToDrop
]
;

let vFieldsToDrop = peek('FieldToDrop');

For each field in $(vFieldsToDrop)
If FieldValueCount('$(field)')>=0 then
Drop Field $(field);
EndIf;
Next field;