Deprecated: Creation of dynamic property CF\WordPress\DataStore::$logger is deprecated in /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-content/plugins/cloudflare/src/WordPress/DataStore.php on line 23

Deprecated: Creation of dynamic property CF\WordPress\Proxy::$pluginAPI is deprecated in /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-content/plugins/cloudflare/src/WordPress/Proxy.php on line 31

Deprecated: file_get_contents(): Passing null to parameter #2 ($use_include_path) of type bool is deprecated in /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-content/plugins/codelights-shortcodes-and-widgets/codelights.php on line 20

Warning: session_start(): Session cannot be started after headers have already been sent in /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-content/plugins/automatic-video-posts/vendor/ternstyle/wordpress/src/class/wordpress.php on line 53

Deprecated: Return type of Requests_Cookie_Jar::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-includes/Requests/Cookie/Jar.php on line 63

Deprecated: Return type of Requests_Cookie_Jar::offsetGet($key) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-includes/Requests/Cookie/Jar.php on line 73

Deprecated: Return type of Requests_Cookie_Jar::offsetSet($key, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-includes/Requests/Cookie/Jar.php on line 89

Deprecated: Return type of Requests_Cookie_Jar::offsetUnset($key) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-includes/Requests/Cookie/Jar.php on line 102

Deprecated: Return type of Requests_Cookie_Jar::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-includes/Requests/Cookie/Jar.php on line 111

Deprecated: Return type of Requests_Utility_CaseInsensitiveDictionary::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-includes/Requests/Utility/CaseInsensitiveDictionary.php on line 40

Deprecated: Return type of Requests_Utility_CaseInsensitiveDictionary::offsetGet($key) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-includes/Requests/Utility/CaseInsensitiveDictionary.php on line 51

Deprecated: Return type of Requests_Utility_CaseInsensitiveDictionary::offsetSet($key, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-includes/Requests/Utility/CaseInsensitiveDictionary.php on line 68

Deprecated: Return type of Requests_Utility_CaseInsensitiveDictionary::offsetUnset($key) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-includes/Requests/Utility/CaseInsensitiveDictionary.php on line 82

Deprecated: Return type of Requests_Utility_CaseInsensitiveDictionary::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-includes/Requests/Utility/CaseInsensitiveDictionary.php on line 91

Warning: Cannot modify header information - headers already sent by (output started at /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-content/plugins/cloudflare/src/WordPress/DataStore.php:23) in /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-includes/rest-api/class-wp-rest-server.php on line 1758

Warning: Cannot modify header information - headers already sent by (output started at /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-content/plugins/cloudflare/src/WordPress/DataStore.php:23) in /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-includes/rest-api/class-wp-rest-server.php on line 1758

Warning: Cannot modify header information - headers already sent by (output started at /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-content/plugins/cloudflare/src/WordPress/DataStore.php:23) in /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-includes/rest-api/class-wp-rest-server.php on line 1758

Warning: Cannot modify header information - headers already sent by (output started at /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-content/plugins/cloudflare/src/WordPress/DataStore.php:23) in /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-includes/rest-api/class-wp-rest-server.php on line 1758

Warning: Cannot modify header information - headers already sent by (output started at /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-content/plugins/cloudflare/src/WordPress/DataStore.php:23) in /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-includes/rest-api/class-wp-rest-server.php on line 1758

Warning: Cannot modify header information - headers already sent by (output started at /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-content/plugins/cloudflare/src/WordPress/DataStore.php:23) in /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-includes/rest-api/class-wp-rest-server.php on line 1758

Deprecated: Creation of dynamic property ternplugin\youtube_video::$post is deprecated in /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-content/plugins/automatic-video-posts/vendor/ternstyle/plugin/src/class/youtube_video.php on line 64

Warning: Cannot modify header information - headers already sent by (output started at /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-content/plugins/cloudflare/src/WordPress/DataStore.php:23) in /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-includes/rest-api/class-wp-rest-server.php on line 1758

Warning: Cannot modify header information - headers already sent by (output started at /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-content/plugins/cloudflare/src/WordPress/DataStore.php:23) in /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-includes/rest-api/class-wp-rest-server.php on line 1758
{"id":314,"date":"2017-07-05T16:23:14","date_gmt":"2017-07-05T23:23:14","guid":{"rendered":"https:\/\/bonbonsguide.com\/wp\/?p=314"},"modified":"2017-07-05T16:23:14","modified_gmt":"2017-07-05T23:23:14","slug":"excel-magic-trick-1446-power-query-count-extract-customer-names-for-8-sales-coupon-groups","status":"publish","type":"post","link":"https:\/\/bonbonsguide.com\/wp\/blog\/2017\/07\/excel-magic-trick-1446-power-query-count-extract-customer-names-for-8-sales-coupon-groups\/","title":{"rendered":"Excel Magic Trick 1446: Power Query Count & Extract Customer Names for 8 Sales Coupon Groups"},"content":{"rendered":"

See how to use Power Query to analyze a group of customers who have been given coupons to three stores. Our goal is to count how many customers used coupons in one of eight coupon groups (all combinations of the three store coupons from the Coupon Redemption Table) and then extract the customer names in each group. Learn about many Power Query features and functions. This trick comes from Bill Szysz, Power Query Master, at YouTube. The data and goals are:
\n1) Each customer was given coupons to go to Wegmans, Publix, Trader Joe’s.
\n2) We have a list of Stores names.
\n3) We have a list of transactions for the coupon redemptions that lists purchases, customer name and store
\n4) Goal 1: Count Customers who visited a given set of stores.
\n5) Goal 2: List Customers who visited a given set of stores.
\nDownload File:
\nStart File: http:\/\/ift.tt\/2tSGcWC
\nFinished File: http:\/\/ift.tt\/2tSGcWC
\nEntire page with all Excel Files for All Videos: http:\/\/ift.tt\/1kSFWvs
\nTopics:
\n1. (00:13) Introduction & Problem Introduction
\n2. (02:35) Import From Excel Table
\n3. (04:01) Left Outer Merge or Left Outer Join
\n4. (06:47) Reference another Query in Power Query
\n5. (07:24) Filter to show null
\n6. (07:49) Group By Feature to aggregate and to list all matching records for Customers who went to Zero Stores. Use Count Rows and All Rows.
\n7. (09:28) Edit Table.Group Function to show just the column and convert to a list rather than a table (Change table type to list type in Group By action).
\n8. (10:07) Underscore character in Power Query = All items in Row
\n9. (11:15) Start Code for final report
\n10. (11:40) Filter out nulls to avoid errors from inconsistent data type in column.
\n11. (12:06) Remove Duplicates
\n12. (12:25) Steps to get three columns, one for each Store and then list the stores that each customer visited: 1) Duplicate Column then Pivot.
\n13. Pivot Features to get a record for each Customer containing the store names that they visited
\n14. (14:00) Group By to Count Customers in each Coupon Group and List of Customers in Each group using Count Rows and All Rows.
\n15. (15:40) Second Time we Edit Table.Group Function to show just the column and convert to a list rather than a table (Change table type to list type in Group By action).
\n16. (16:02) Append Earlier Query to current query so that the count and list of customers that visited no stores is listed in the final report.
\n17. (16:34) Edit Previous Query to update current query.
\n18. (17:26) Add Custom Column to Convert the Record to a List. This lists created for each row will be the columns in the final report. In this step see the Power Query Functions: Record.ToList, List.RemoveLastN. Also see how join the record to a columns and add a null row.
\n19. (20:40) Create a column that represents the Field Names (Column Names \/ Headers) in the final Table\/Report. See how to add a column as an Index and then add a Prefix.
\n20. (21:31) Edit M Code using Advanced Editor and add a line of code that uses the Table.FromColumns Function to combine the Columns and Headers into a table.
\n21. (23:40) Thanks to Bill Szysz
\n22. (24:08) Summary<\/p>\n

Related Videos:
\nExcel Magic Trick 1444: Logical Formulas: Count & Extract Customer Names for 8 Sales Coupon Groups
\nExcel Magic Trick 1444 Part 2: Count Customer Names for 8 Sales Coupon Groups
\nExcel Magic Trick 1445: Single Cell Array Formula: Count Customer Names for 8 Sales Coupon Groups
\nExcel Magic Trick 1446: Power Query Count & Extract Customer Names for 8 Sales Coupon Groups
\nExcel Magic Trick 1447: DAX Formulas to Count Customers in 8 Sales Coupon Groups & List Store Names<\/p>\n