genevieve charbon Posted June 3, 2009 Posted June 3, 2009 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
comment Posted June 3, 2009 Posted June 3, 2009 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.
genevieve charbon Posted June 4, 2009 Author Posted June 4, 2009 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
comment Posted June 4, 2009 Posted June 4, 2009 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.
genevieve charbon Posted June 4, 2009 Author Posted June 4, 2009 The key will be generated when the user puts the sku in the group, so it will be plain text and will get indexed.
comment Posted June 4, 2009 Posted June 4, 2009 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).
genevieve charbon Posted June 5, 2009 Author Posted June 5, 2009 when user hads a sku in the group a script willbe trigered that will update the group key. so the key remains indexed
comment Posted June 5, 2009 Posted June 5, 2009 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.
genevieve charbon Posted June 8, 2009 Author Posted June 8, 2009 Thanks comment, The auto-update did the trick
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now