Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Remove Duplicate fields in PIVOT

Vikas27
7 - Meteor

Hi Community, 

 

I was creating a pivot table on my dataset and i've used Summarize tool to build the Pivot where i did Group by with Name, Strategy, Product Group, Book and did Sum for the rest of data set. But, unlike in excel i am not getting data in presentable format as I see duplicates in all the group by fields as below. 

 

NameStrategyProduct GroupBookSum New BusinessSum_EditSum_FX
Vikas PasrichaHY28TRSMMTC12030
Vikas PasrichaHY28TRS3HGY22131
Vikas PasrichaHY28TRSRESL32232
Vikas PasrichaHY29TRSMDSS42333
Vikas PasrichaHY29TRSMRTE52434
Vikas PasrichaReservesNA Deriv1HYM62535
Vikas PasrichaReservesNA Deriv2HYE72636
Vikas PasrichaReservesNA Deriv3HGY82737
Asish ChinariHY34CD Index TrancheMMTC92838
Asish ChinariHY34CD Index TrancheRESL102939
Asish ChinariHY35CD Swap IndexMRTE113040
Asish ChinariHY35CD Swap Index2HYE123141
Asish ChinariHY35CD Options3HGY133242

 

However, I want my data to be representable as below wherein i should not see duplicates and have unique data which looks more clean and representable. 

 

Can we create data in the below format in Alteryx? I was thinking of using Unique feature but not sure it will work. Is there any other way if possible or we can't create excel like Pivot in Alteryx. 

 

NameStrategyProduct GroupBookSum New BusinessSum_EditSum_FX
Vikas PasrichaHY28TRSMMTC12030
   3HGY22131
   RESL32232
 HY29TRSMDSS42333
   MRTE52434
 ReservesNA Deriv1HYM62535
   2HYE72636
   3HGY82737
Asish ChinariHY34CD Index TrancheMMTC92838
   RESL102939
 HY35CD Swap IndexMRTE113040
   2HYE123141
  CD Options3HGY133242

 

Thanks to community for their assistance as always ! 

 

Best Regards

Vikas 

6 REPLIES 6
IraWatt
17 - Castor
17 - Castor

Hey @Vikas27,

I've attached a workflow which I think is inline with the logic above

IraWatt_0-1651603229379.png

If you want any explanation on how the multi row formula work make sure to ask :)

HTH,

Ira

 

Vikas27
7 - Meteor

Hi Ian,

 

Thanks for the response. I ran your Workflow i'm getting the desired result. However, when i try to run the same on my dataset i am facing an issue -

 

a) When I run first Multi-Row Formula i am getting name getting corrected where i see duplicates removed. 

 

b) BUT when I add 2nd Multi-Row Formula in Strategy tab i) Strategy tab see no impact at all and secondly the result which is coming is my results in Name get amended with Strategy and i see Strategy in my results in Column Name. However, there is no change in Strategy column. 

 

BUT same is not happening in your WF. Do you know why it's happening. 

 

Thanks. 

Vikas27
7 - Meteor

@IraWatt - Please ignore i made some goof up at my end. Thanks for all your help I got the resulted as expected but i don't understand the Multi-Row formula. Can you please help me understand what i have done and what this function help us achieve

 

I'll accept your solution. 

 

Thanks,Vikas 

IraWatt
17 - Castor
17 - Castor

Hey @Vikas27,

No worries ! XD 

 

IF [Row-1:Right_Name]= NULL() THEN [Name] 
ELSEIF [Row-1:Right_Name]=[Right_Name] THEN NULL()
ELSE [Right_Name] ENDIF

 

 

I have the first multi row formula code above. Before the formula I joined the records with each other on their position essentially creating a duplicate for every column (new columns pre appended with right). The reason I did that was to ensure as the multi row updates each row I still have a duplicate Name/strategy/ect to refer to.

Multi row formula work row by row applying logic (if my explanation doesn't makes sense maybe be best to watch the Alteryx community video on multi row formula too). The first multi row tool updates the value in the name column.

 

The first line checks if the duplicate is NULL, if yes it will leave the name column as is. If duplicate (right_Name) of the row above then the Name column is updated with NULL. Then finally if they don't match then just use the duplicate name.

 

Its a bit difficult to explain possibly the best approach is to check Alteryx's video and then go row by row trying to apply the logic in the formula to understand it. 

Hope some of that made sense,

Ira

Vikas27
7 - Meteor

Actually, you have explained it beautifully and i can understand from the IF Condition making perfect sense. But yeah will see Alteryx video as i want to understand primarily how and where all i can use this function. As i'm not from coding background so takes time to grasp as i was not aware or familiar with the Multi-row function.

 

But yeah, that's why we have lovely Alteryx community who is there to help. Anyways, thanks a lot ! Appreciate your help on the issue. :)

IraWatt
17 - Castor
17 - Castor

No worries, thanks @Vikas27 ! XD  

Labels
Top Solution Authors