Skip export if no rows
Hi,
I am looking to skip an export if it has no rows. I know that you can verify a model to see if it has no rows but the options there are Continue, Stop, Stop without error and in Visual there is one more Continue with verified only. I tried the Visual process using continue with verified only but I guess I didn't set it up right.
I have one large file that has multiple reports inside it so I needed to create 4 models to grab the necessary data, each with its own export. Two of the models are to capture adjustments, which don't always occur daily, so I would like to skip this export if there is no data on these exports and continue with the rest of the process.
Has anyone used verify model and got it to skip the export? I don't want the process to stop as I still have more exports after these 2.
V14.3 Server
Answers
-
Hi Patrick,
The model verify has many options, including the following:
Filter produces at least one row: assign a filter which will return a row
Filter produces no rows: assign a filter which will not return a row
Modify your model:
Add a formula field, call this field RecCount, make it numeric field, and assign this function: recno()
Add a filter and name it RecCountGTzero, and assign this expression: RecCount=1
In the following Visual Process there are two jobs (two models, and two model verifies)
Configure the model verify for each job, check Filter produces at least one row, and assign the RecCountGTzero filter (per screenshot below).
If the first job does not create a row, the export will be skipped and the process continue with the second job. This example is for two jobs, but you can add more jobs for different models.
Regards
Mo
0 -
Altair Forum User said:
Hi Patrick,
The model verify has many options, including the following:
Filter produces at least one row: assign a filter which will return a row
Filter produces no rows: assign a filter which will not return a row
Modify your model:
Add a formula field, call this field RecCount, make it numeric field, and assign this function: recno()
Add a filter and name it RecCountGTzero, and assign this expression: RecCount=1
In the following Visual Process there are two jobs (two models, and two model verifies)
Configure the model verify for each job, check Filter produces at least one row, and assign the RecCountGTzero filter (per screenshot below).
If the first job does not create a row, the export will be skipped and the process continue with the second job. This example is for two jobs, but you can add more jobs for different models.
Regards
Mo
Hi Mo,
Thanks for the help. I was able to get it to skip by using the 'Unfiltered table has at least one row' option'.
But now the issue is that when the verify fails it says 'some inputs are not verified' and then the export says 'there are no inputs to process. export will be skipped'. The issue is we have a global alert set up for visual processes that we will be sent an email each time it skips the export, is this always the case that an email will be sent when an export skipped? There is an input that the verify model just used, so this warning saying that there is no input to process is misleading to the alert.
Thanks again Mo
0 -
Altair Forum User said:
Hi Mo,
Thanks for the help. I was able to get it to skip by using the 'Unfiltered table has at least one row' option'.
But now the issue is that when the verify fails it says 'some inputs are not verified' and then the export says 'there are no inputs to process. export will be skipped'. The issue is we have a global alert set up for visual processes that we will be sent an email each time it skips the export, is this always the case that an email will be sent when an export skipped? There is an input that the verify model just used, so this warning saying that there is no input to process is misleading to the alert.
Thanks again Mo
Hi Patrick,
I can see your point, unfortunately the SystemAlertNoInputToExporter will be raised when the verify model fails, and when it fails it causes the following message:
There are no inputs to process. Export will be skipped. I will discuss this in our next Automator meeting with the product manager.
If you need an email to be generated when the verify model fails , you can add an email distribution and connected to the Verify model (on the visual process canvas, right click and select Show Advanced connectors). You should see red colored chevron. Connect the verify model to the email distribution. When verify model fails, an email will be generated.
Regards
Mo
0 -
Altair Forum User said:
Hi Patrick,
I can see your point, unfortunately the SystemAlertNoInputToExporter will be raised when the verify model fails, and when it fails it causes the following message:
There are no inputs to process. Export will be skipped. I will discuss this in our next Automator meeting with the product manager.
If you need an email to be generated when the verify model fails , you can add an email distribution and connected to the Verify model (on the visual process canvas, right click and select Show Advanced connectors). You should see red colored chevron. Connect the verify model to the email distribution. When verify model fails, an email will be generated.
Regards
Mo
Thanks Mo. You answered all my questions.
0