Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
viveksairam89
Creator
Creator

Qliksense using batch file

Hello,

I have requirement that is the housekeeping requirement using qliksense and batch file script,the stored QVD's should be deleted

But the condition is shouldn't delete the last 2 months Monday qvd and last week 5 days(Mon-fri) qvds

Can you give me some solutions for this requirement

1 Solution

Accepted Solutions
viveksairam89
Creator
Creator
Author

Hello all,

Using FORFILES i have achieved the requirement

ECHO

FORFILES -p %QLIKPATH% /M *.qvd /C "cmd /c  for /f %%i in ('powershell ^(Get-Date @fdate -f ddd^)') do if not %%i == Mon echo @file" /D -%DAYSAGO%      >> D:\log.txt 2>&1

Delete

FORFILES -p %QLIKPATH% /M *.qvd /C "cmd /c for /f %%i in ('powershell ^(Get-Date @fdate -f ddd^)') do if not %%i == Mon del @path " /D -%DAYSAGO%       >> D:\log.txt 2>&1

View solution in original post

9 Replies
fkeuroglian
Partner - Master
Partner - Master

Hi vivek

The question is how to call a batch file or how will be the process in general?

You have to do is:

1) Create a qvf that load the qvd and all unless 2 months

2)Create a bat that call qvf 1)

3)when you want to call the bat created in 2)?? in another part of qvf in the script? in a specific period?

Please explain a little more to be easier to help you

Fernando K.

viveksairam89
Creator
Creator
Author

Thanks for your reply Fernando

  The thing need to create batch file script which runs and deletes the 2 months of Qvd except Mondays and last week qvd,

It involves Housekeeping activity

Iam struck with bat file scripting,so can you help me out on this

viveksairam89
Creator
Creator
Author

Hello all,

Using FORFILES i have achieved the requirement

ECHO

FORFILES -p %QLIKPATH% /M *.qvd /C "cmd /c  for /f %%i in ('powershell ^(Get-Date @fdate -f ddd^)') do if not %%i == Mon echo @file" /D -%DAYSAGO%      >> D:\log.txt 2>&1

Delete

FORFILES -p %QLIKPATH% /M *.qvd /C "cmd /c for /f %%i in ('powershell ^(Get-Date @fdate -f ddd^)') do if not %%i == Mon del @path " /D -%DAYSAGO%       >> D:\log.txt 2>&1

wangxusq
Contributor III
Contributor III

Hi,

Could you tell me how to call a bat file In QlikSense ?I want to click something then trigger the bat file in QS.

Thanks

viveksairam89
Creator
Creator
Author

Hi,

LET vExeLine = 'B:\Qlik\Scripts\foldername\run.bat' ;

execute cmd /C $(vExeLine);

wangxusq
Contributor III
Contributor III

Hi ,

this must execute in the script ?

My requirement is : in the sense hub interface ,I want to click a button and then trigger the bat , not  reload the script again.

Thanks

viveksairam89
Creator
Creator
Author

Hi,

Yes that should be executed in script, we can create a Trigger button in qliksense itseems,

so we should use in script or else we can write a extensions

wangxusq
Contributor III
Contributor III

So if I want to pass variable to the bat file.The variable is my current selection? And other question:my script has many many lines,if I created a trigger to execute bat file by the script,then can I just execute the specified partial script? I not want to execute many many lines,need a lot of time.

在2017年10月13日 16:39:59, "vivek sm" <qcwebmaster@qlikview.com> 写道:

|

|

|

|

|

Qliksense using batch file

reply from vivek sm in New to Qlik Sense - View the full discussion

Hi,

Yes that should be executed in script, we can create a Trigger button in qliksense itseems,

so we should use in script or else we can write a extensions

Reply to this message by replying to this email, or go to the message on Qlik Community

Start a new discussion in New to Qlik Sense by email or at Qlik Community

Following Qliksense using batch file in these streams: Inbox

|

|

© 1993-2016 QlikTech International AB | Copyright & Trademarks | Privacy | Terms of Use | Software EULA

viveksairam89
Creator
Creator
Author

Execute bat file through qliksense that is the concept,for better understanding can you provide some screen shots