Exporting multiple query counts into one CSV file | Community
Skip to main content
May 7, 2025
Solved

Exporting multiple query counts into one CSV file

  • May 7, 2025
  • 1 reply
  • 769 views

I have a workflow with multiple queries for counts and I would like to export all of these to one CSV.
All I need to have is the name of each query and it's associated count.

Step by step guide please as still fairly new to this.

Thank you.

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SatheeskannaK

@clivefo 

  • In the additional data section of each query activity, utilize the count function to retrieve the number of records, assigning a label that matches the query criteria.
  • Connect the outbound transition of all the query activities to AND-join
  • Connect the outbound transition of AND-join with the extract file activity.
  • Set up the Extract file activity using the count expressions you've included in the additional data section of each query activity.

Have a look at this documentation,

How to additional data on query activity - https://experienceleague.adobe.com/en/docs/campaign-standard/using/managing-processes-and-data/targeting-activities/query

How to use the AND-join,

https://experienceleague.adobe.com/en/docs/campaign-standard/using/managing-processes-and-data/execution-activities/and-join

How to use the extract file activity,

https://experienceleague.adobe.com/en/docs/campaign-standard/using/managing-processes-and-data/data-management-activities/extract-file

List of functions,

https://experienceleague.adobe.com/en/docs/campaign-standard/using/managing-processes-and-data/filtering-data/list-of-functions

1 reply

SatheeskannaK
Community Advisor
SatheeskannaKCommunity AdvisorAccepted solution
Community Advisor
May 8, 2025

@clivefo 

  • In the additional data section of each query activity, utilize the count function to retrieve the number of records, assigning a label that matches the query criteria.
  • Connect the outbound transition of all the query activities to AND-join
  • Connect the outbound transition of AND-join with the extract file activity.
  • Set up the Extract file activity using the count expressions you've included in the additional data section of each query activity.

Have a look at this documentation,

How to additional data on query activity - https://experienceleague.adobe.com/en/docs/campaign-standard/using/managing-processes-and-data/targeting-activities/query

How to use the AND-join,

https://experienceleague.adobe.com/en/docs/campaign-standard/using/managing-processes-and-data/execution-activities/and-join

How to use the extract file activity,

https://experienceleague.adobe.com/en/docs/campaign-standard/using/managing-processes-and-data/data-management-activities/extract-file

List of functions,

https://experienceleague.adobe.com/en/docs/campaign-standard/using/managing-processes-and-data/filtering-data/list-of-functions

Thanks, Sathees
CliveFoAuthor
May 12, 2025

Thanks, for this. We have queries that count over all time, we run this weekly but have to manually update the dates to three days prior the current date (this is because we are checking against another system that runs 3 days behind). So, my question is can this be done automatically i.e. TODAY-3 similar to other systems?

SatheeskannaK
Community Advisor
Community Advisor
May 12, 2025

@clivefo You can update the query to look for today-3 (relative to today option) in the query criteria or else setup a filter that can be used on the query activities.

https://experienceleague.adobe.com/en/docs/campaign-standard/using/developing/adding-or-extending-a-resource/configuring-filter-definition

Thanks, Sathees