Page 1 of 1

Calculate amount

Posted: Tue Nov 10, 2020 9:56 am
by Terkelsen
I have 8 to 10 dummy-files coming in from different Submit Points, that submits data only. Each of these files contain a metadata tag, that is an amount selected from at drop-down in the Submit point. I need to make a calculation that adds the numbers in the tag "amount" from all thes files.

I have tried to use Assemble Job in order to merge the metadata so that all information is in each file. However, I need the dataset name of these Submit points to be the same, because that information is used later on in the flow, so making individual names for the data sets is not an option. When assembling jobs with data sets with identical names one will overwrite the other.

I tried to write the information into Private data of each file, but merging metadata when assembling will not merge Private Data.

Any ideas of how to merge this information form each file into one, so that a calculation can be done?

PS: The database module is not available in this installation.

Re: Calculate amount

Posted: Tue Nov 10, 2020 10:08 am
by jan_suhr
Have you tried to use different Dataset names from the submit point and then use Make XML to combine them in to one XML that you later pickup to the assembled job. It should work for you

Re: Calculate amount

Posted: Tue Nov 10, 2020 10:17 am
by laurentd
The Counter Numberer app can also help you.
Add all the values to a counter, and read the total value when you want.
It will be attached as private data.
You can then reset the counter for the next batch of files, or define the counter names based on one common job property.
https://www.enfocus.com/en/appstore/product/counter

Re: Calculate amount

Posted: Tue Nov 10, 2020 10:45 am
by freddyp
Terkelsen wrote: Tue Nov 10, 2020 9:56 am I have 8 to 10 dummy-files coming in from different Submit Points, that submits data only.
You submit dummy files, probably to submit metadata, and not data only, correct? In that case, know that you can also define a submit point as submitting metadata only. Switch will then create an empty text file automatically that serves as a vehicle for the XML metadata from the submit point. It is nicer for the user that way.

Re: Calculate amount

Posted: Tue Nov 10, 2020 12:03 pm
by Terkelsen
@ Jan. As mentioned giving the datasets different names is not an option because the Data set name is later used to add text to a PDF. If the Submit Points have different names I would need to make different variable sets for every Submit Point and as there will be maybe 50 different Submit Points, that won't work.

@ Freddy. Yes, I'm submitting meatdata only and Switch creates the dummy files. The problem is how to gather information from each of these dummy files and use them to calculate. Each file hold information like this:
[Metadata.Text:Path="/field-list/field[2]/value",Dataset="Submit_1",Model="XML"]

I need to collect this information from each file and calculate the SUM.

Re: Calculate amount

Posted: Tue Nov 17, 2020 10:37 am
by Terkelsen
Just for your information, I solved this using Jan's app called "Take Note". With this app I can add a specific dataset unique to each Submit Point and still keep the dataset "Submit_1", which is the same for all Submit Points.

After assembling the files I then end up with metadata containing the dataset "Submit_1", where one overwrites the other but in addition I have a list of datasets specific to each Submit Point. This way I have the information about amount collected in the metadata for each file, and it can be used for calculating the total amount.