When we refresh extract then it will run sometime then only new data will come in place.
Please export later on that.
Yes, but I am automating it.
When I run the commands through .bat file , it is running parallely and thats the reason I am not getting the new exported sheet.
Hi Shivang Desai,
Why can't you keep it in two different scripts.
In the first script - You complete your extract refresh
In the second script - If first script is successful then only run this script.
You do the export of the report whichever you want that is using the data which you refreshed in step 1.
This approach will be good for you even if some issue happened and your first script failed then your export won't run.
Please let me know, if it is helpful.
Even if I keep the refresh and exports in 2 different scripts, how can I check whether the refresh script (1st script) is successful?
Is there any technique?
When you are scheduling a BAT script in Windows scheduler. You can add the dependency saying Script 2 has to run only after Script 1 is successfull.
please let me know if you still have any queries on this.
This solution/approach will be definitely helpful and works for you.
There is one way I can do is my first script (refresh) can start refreshing for example 10 am.
Another script (export) can be then start at 11 am because I am sure my first script will run within 1 hour time.
But I want to check whether my first script is successful and have a proper dependency. Could you please let me know the process or link you are aware of?
Two ways :
1. keep a condition in your script after the first command (extract refresh) to set the time delay to execute your second command (export)
2. Query the postgres database and check your extract status to run your second command (export).
both of them is possible.
Please mark it as helpful, if you feel i shared all the details which you can start working on..
Can I get the exact commands to be used?
1 of 1 people found this helpful
I gave the solution/Approach which will suffice your requirement.
This will be a day or two days work effort for you to implement and test everything.
here are some commands : First login command..hope you know how to do ..
TABCMD refreshextracts --workbook workbook name --project project name
tabcmd export %site% %report_loc% %format% %pagelayout% %pagesize% -f %attachment% >> %log%
Extract status check:
SELECT X.Job_ID ,X.Refresh_Start_Date ,X.Refresh_End_Date ,X.Workbook_Name ,X.Finish_Code ,X.Notes FROM ( SELECT DISTINCT w.name AS Workbook_Name ,bj.started_at AS Refresh_Start_Date ,bj.completed_at AS Refresh_End_Date ,CASE WHEN bj.finish_code = 0 THEN 'TABETL_SUCCESS' ELSE 'TABETL_FAILURE' END AS Finish_Code ,bj.id AS Job_ID ,bj.job_name AS Job_Name ,bj.notes AS Notes ,RANK() OVER(partition by w.name order by w.name, bj.started_at desc) AS Ranking FROM background_jobs AS bj INNER JOIN workbooks AS w ON (w.name = bj.title) WHERE bj.subtitle = 'Workbook' AND age(bj.started_at) <= INTERVAL '7 days' ) AS X WHERE X.Ranking = 1 ORDER BY X.Refresh_Start_Date DESC, X.Workbook_Name;
Let me know, if you struck on any of the steps ..i can definitely chip in and help you in finishing the solution for you.