cancel
Showing results for 
Search instead for 
Did you mean: 

Increment JSON Name with 1 after last highest record

SOLVED
rxak
Meteoroid

Increment JSON Name with 1 after last highest record

Hello experts!

 

I'm currently in the process of building API endpoints through Alteryx. I have managed to do that where I'm basically using the Download Tool and JSON Tool. After this, I'm filtering the JSON Name by CrossTab (each record has a number 0,0,0,1,1,1,2,2,2, so I'm basically grouping them based on the duplicate integers)

 

However, here is the catch: When I add a second endpoint, the JSON Name goes from 0,0,0,1,1,1,2,2,2 and then back to 0,0,0,1,1,1 which is fine (it is behaving as it should), but my issue is that when I want to use the CrossTab it only takes the unique records, so the second endpoint is not being transformed by the CrossTab. 

 

Ideally what I would like is that it compares if that number already exists, if it does then just continue from the last highest record, so in this example it should not go from 2,2,2 and then back to 0,0,0 but continue adding +1 so it is 3,3,3,4,4,4 etc.

 

JSON_NameConnectionID
0A123
0A123
0A123
1A123
1A123
1A123
2A123
2A123
2A123
0B123
0B123
0B123
1B123
1B123
1B123

 

Please let me know, if my question doesn't make sense Smiley Happy

 

Thank in advance!

4 REPLIES 4
rxak
Meteoroid

Increment JSON Name with 1 after last highest record

Hello experts!

 

I'm currently in the process of building API endpoints through Alteryx. I have managed to do that where I'm basically using the Download Tool and JSON Tool. After this, I'm filtering the JSON Name by CrossTab (each record has a number 0,0,0,1,1,1,2,2,2, so I'm basically grouping them based on the duplicate integers)

 

However, here is the catch: When I add a second endpoint, the JSON Name goes from 0,0,0,1,1,1,2,2,2 and then back to 0,0,0,1,1,1 which is fine (it is behaving as it should), but my issue is that when I want to use the CrossTab it only takes the unique records, so the second endpoint is not being transformed by the CrossTab. 

 

Ideally what I would like is that it compares if that number already exists, if it does then just continue from the last highest record, so in this example it should not go from 2,2,2 and then back to 0,0,0 but continue adding +1 so it is 3,3,3,4,4,4 etc.

 

JSON_NameConnectionID
0A123
0A123
0A123
1A123
1A123
1A123
2A123
2A123
2A123
0B123
0B123
0B123
1B123
1B123
1B123

 

Please let me know, if my question doesn't make sense Smiley Happy

 

Thank in advance!

Re: Increment JSON Name with 1 after last highest record

@rxak, can you specify what the output should be in your case? As per my understanding, you are looking to do something like this.

 

JSON_NameConnectionID
0A123
0A123
0A123
1A123
1A123
1A123
2A123
2A123
2A123
3B123
3B123
3B123
4B123
4B123
4B123

 

Thanks!

Sapna Gupta

Re: Increment JSON Name with 1 after last highest record

@rxak, is this what you are looking for?

grazitti_sapna_0-1655807076065.png

Thanks!

Sapna Gupta
Attachment
Download this attachment

Re: Increment JSON Name with 1 after last highest record

That was exactly what I was looking for! Thank you Smiley Very Happy Good to know about the Tile tool! Smiley Happy

Highlighted

Re: Increment JSON Name with 1 after last highest record

@rxak, Glad I could help Smiley Happy

Sapna Gupta