Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
priyarane
Specialist
Specialist

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
Partner - Specialist II
Partner - Specialist II

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;

View solution in original post

7 Replies
sergio0592
Specialist III
Specialist III

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
Partner - Specialist II
Partner - Specialist II

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

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

flipside

priyarane
Specialist
Specialist
Author

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

priyarane
Specialist
Specialist
Author

Hi Dave, can you pls elaborate pls.

flipside
Partner - Specialist II
Partner - Specialist II

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
Specialist
Specialist
Author

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
Partner - Specialist II
Partner - Specialist II

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;