Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
GELÖST

SumIf with multiple criteria

Hello everyone,

 

I'm new to Alteryx designer and I have a challenge to solve and need your help. 

 

I have store sales data for multiple stores in two different currencies, I want to sum sales amount following the below criteria:

Sum main and branch-store sales into one line if the value date of both main & branch matches, else return with a comment "value date for main and sub store are different". FYI - There are some stand-alone stores as well with no main store for them. Attached is the file with raw data and desired output. 

 

Thanks for your help.

 

Regards,

Shabeer

 

5 ANTWORTEN 5
geraldo
Pulsar

@mohdshahtab 

 

An workflow example

flying008
Magnetar

Hi, @mohdshahtab 

 

Another clean way for you reference:

录制_2023_07_17_10_17_26_214.gif

 

1- Select: Uncheked fields [Sales Total - Local] and [Sales Total - Base] , because it to be sum.
2- Summarize: Group by [Main Store] and [Value Date], Sum of [Sales Total - Local] and [Sales Total - Base], Last of [Store Name].
3- Find&Replace: Find [Store Name] with [Store Name] by 'Entire Field', Append fields with [Sales Total - Local] and [Sales Total - Base].
4- Summarize: Group by [Main Store], Concatenate with [Value Date].
5- Formula: New field [Comments] to get 'Main & Branch store value dates not same'.
6- Find&Replace: Find [Main Store] with [Main Store] by 'Entire Field', Append fields with [Comments].
7- Filter: filter [Sales Total - Local] is not null.

 

Input      
Store IDMain StoreStore NameValue DateSales Total - LocalSales Total - Base 
9A3EBC2BF988D312DollarSmart3/31/202334333388.37 
D1F92601F988D312Megaplex3/31/202325542613.76 
FC36EDD1FC36EDD1Fuller Shelf3/31/202330823154.12 
EB478028 Organicum4/30/202387968681.65 
4146AE19 Shopperia5/31/202351755296.1 
3999CBF0 Freshcommerce9/30/202278347732.16 
6C655E45FC36EDD1Magnolia Market12/31/202278567856 
F988D312F988D312RedFox Shop3/31/202312141214 
D931335A Studio Belle2/28/202381588051.95 
F0D73B28FC36EDD1eFarms1/31/202288348719.16 
AB19ECA1 Vendira6/30/202390518933.34 
       
Output      
Store IDMain StoreStore NameValue DateSales Total - LocalSales Total - BaseComments
FC36EDD1FC36EDD1Fuller Shelf3/31/202330823154.12Main & Branch store value dates not same
EB478028 Organicum4/30/202387968681.65 
4146AE19 Shopperia5/31/202351755296.1 
3999CBF0 Freshcommerce9/30/202278347732.16 
6C655E45FC36EDD1Magnolia Market12/31/202278567856Main & Branch store value dates not same
F988D312F988D312RedFox Shop3/31/202372017216.13 
D931335A Studio Belle2/28/202381588051.95 
F0D73B28FC36EDD1eFarms1/31/202288348719.16Main & Branch store value dates not same
AB19ECA1 Vendira6/30/202390518933.34 

 

 

******

If can help you get your want, please mark it as a solution and give a like to more share.

Hi @flying008 

 

Thanks for your reply. Attached is the .xlsx file your reference. I would prefer we consider store ID and not use store name within find and replace tool. 

flying008
Magnetar

Hi, @mohdshahtab 

 

录制_2023_08_25_14_52_03_896.gif

Hi @flying008 - ID row will then be used to import sales figures into another application, so ID becomes the identifier for the application to identify the store. Thanks!

Beschriftungen