sum total from multiple values from privatedata

Post Reply
rhd_ole
Member
Posts: 103
Joined: Mon Jan 24, 2022 5:36 pm

sum total from multiple values from privatedata

Post by rhd_ole »

Hi All -

I have a privatedata key 'Price' that I need to provide sum of and I'm entirely sure the best way to do it.

Lets say there are 4 files in the run, all have a different price which is recorded to privatedata as 'Price' and I need to provide the sum of all the files in the run. The number of files will not be static.

Any ideas on how to do this? I also have the data in a csv if that helps.


Thanks

-O
Color Science & Workflow Automation
laurentd
Member
Posts: 142
Joined: Wed Mar 13, 2019 2:06 pm

Re: sum total from multiple values from privatedata

Post by laurentd »

You can use the Counter - Numberer app, which allows you to create counters independent of jobs.
Your first job comes in and creates a new counter, with name equals to a common metadata.
Following files come in and increment the counter.
At the end you can read the counter value.

Using the csv file:
You can import it in a Google Sheet using Google Sheets Connect,
then add a sum formula in a new column (using Edit values),
then lookup the sum value.
It will add the values of all cells as private data to your job.
Laurent De Wilde, Solution Architect @ Enfocus
User avatar
JimmyHartington
Advanced member
Posts: 310
Joined: Tue Mar 22, 2011 7:38 am

Re: sum total from multiple values from privatedata

Post by JimmyHartington »

If you want to use the CSV you can use https://www.easydatatransform.com, which can be used as a CLI-program with Switch.
It is very affordable in regards to what it does.

See this topic: viewtopic.php?p=15038&hilit=easy+data+transform#p15038 on how to implement it.
rhd_ole
Member
Posts: 103
Joined: Mon Jan 24, 2022 5:36 pm

Re: sum total from multiple values from privatedata

Post by rhd_ole »

Thanks all - I ended up writing a script calculated the sum of the column and passed it and I used is a private data as needed.
Color Science & Workflow Automation
elija6266
Newbie
Posts: 3
Joined: Mon Mar 04, 2024 8:29 am

Re: sum total from multiple values from privatedata

Post by elija6266 »

Thanks @JimmyHartington for sharing this information.
Post Reply