Unique lookup values involving numbers

Hi! I asked this question in another thread, but it was closed as the original problem was solved. This is a secondary problem:

I’m looking up numbers (profit), and then I want the stock symbol associated with that number. However I did notice that if two stock symbols have the exact same profit total for the month, one of them is eliminated during the unique element array plugin. How can I show both numbers/symbols even if the number is the same, but the symbol is different?

Honestly I think I would have approached it differently if I was doing it from scratch. I realize the important goal is to get your top 5 sorted properly, and there is a bit of a disconnect when sorting the numbers while trying to maintain a link with the symbol.

Sticking with your current setup, one thought would be to divide your numbers by 10000 so you get the amount in decimal form. Then use a template column to join the symbol to the end with a delimiter in between. The goal is to get a text string with the amount and the symbol together, with leading zeros, so you can properly sort it. So I envision it looking something like this:
‘0.0847|LCID’

Then you can sort that joined value and should get the same sort order. Then later, when you pull your top 5 back into separate columns, you’ll get the joined value, which you can further split on the | delimiter and multiply you number by 10000 to get back to it’s original form. It adds even more columns, but at the same time, you should be able to remove you relation and lookup columns to get the symbol, because you will already have it.

Hope that makes sense.

2 Likes

Thank you for this answer. I will try to process it and see if I can get it to work.

Just out of curiosity, what would your approach be if starting from scratch? I’m eager to learn :grinning:

1 Like

I’m not sure what I would do differently. It’s something I would probably have to rebuild myself to say for sure. Mainly the thing I know I would have done differently is to not use the number for a relation to get back to the symbol, for exactly the same reason you have come across. I think if you can sort the number and symbol as a combined value alphabetically instead of numerically, then you should still get the same sorting, but then have the ability to pull that number and symbol back apart by using a split text column to split on the pipe delimiter (or whichever delimiter you choose), and then use a couple of single value columns to get the number and the symbol out of that split array. It gets to be a lot since you have to do everything 5 times.

If I think of anything different or get a chance to play with the copy I have of your app, then I’ll let you know. I just have a lot going on with the holidays right now.

1 Like

Awesome thank you! I appreciate all your help and expertise. I wish you and your family a wonderful holiday season!

1 Like

why are you doing unique profits? if you wanna show all the profits?

Same to you!

May I know what is your desired end result? What is the flow that lead the user to this point?

Hi! I’m looking up unique profits and their tickers on a per month basis so I can display a “Top 5” list for the user like this:

Screen Shot 2021-12-23 at 9.34.23 PM

Sure thing - So the user enters several trades each month, each generating a profit/loss. The app would then total all profits for that ticker symbol for that month, rank them, then display a “Top 5”. I just posted a screenshot in the post below. I hope that answers your question!

You know, when you put it like that it seems to me that you may have over complicated this.
Couldn’t you just present an inline list of trade symbols ordered by profit, and limit the list to 5 items?

4 Likes

Yeah I think so. He can just sort the list by profit then limit it to 5 items, right?

2 Likes

:sob: Of course! Leave it to me to make things over complicated?!?!

This works wonderfully now and I can get rid of so many columns! Thank you!! I remember you originally said there was probably a better way to do it, and you found it :+1:

I wish you and your family a safe and wonderful holiday season!

Screen Shot 2021-12-24 at 8.12.05 AM

2 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.