Jump to content

This topic is 5742 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hi,

I have a group of unlimited products, the each group

group_id SKU sku_order

1 AJ 1

1 OK 2

1 LM 3

I want to create a key for performance reasons for each unique group which is the concatenated SKUs

so the key of group one would be

AJ OK LM

But to me the sku order is just a cosmetic issue, for my use

LM AJ OK

would be the same

so I'd like to generate a key that's the same regardless the order.

so I need a trasnformation that would give the same result

f(AJ OK LM)=Key

f(LM AJ OK)=Key

Key=Key

Posted

You could use a value list to sort your items alphabetically. Or just sort the relationship - the List() function will follow that. I am not sure what's purpose here - you already have a common key value.

Posted

Yes the ordering seems a good idea but it only works just during the creation of the group. If the user changes the order afterwards, then it doesnt work. The goal is to have an indexed key. So valuliest aren't possible.

Of course, we can recrate the key when user changes the order that's true, but cumbersome

Posted

The goal is to have an indexed key.

Your original post didn't say anything about indexing. As I am sure you are well aware, a calculation that references data from other records must be either unstored or it will not update automatically when the referenced values change.

This has nothing to do with the question of ordering those values: to use your own terminology, f(AJ;OK;LM) cannot be indexed, because (AJ;OK;LM) cannot be indexed.

Posted

I don't understand your post: when user adds a sku to a group, the other members of the group will either update their key (if unstored) or not (if indexed).

Posted

Well, then what's the problem? When the script updates the group key, have it update the key with a sorted version. Or have another text field with an auto-entered calculation that will update when the group key is modified.

FWIW, I don't see the purpose of this, and I don't think it's good practice.

This topic is 5742 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.