on 2024 Jul 12 1:40 PM
Hi All
I am wanting to delete duplicate records from a model using a specified key (combination of dimensions). For example, in the below "BEFORE" image, I have 2 records for Customer = '123'. I would like to delete the top record where Customer Group = '#'. I do not want to delete all records Customer Group = '#', because for the likes of Customer = '456', there is only 1 record.
I have tried coding an advanced formula data action, but can't seem to get it right.
Can someone please assist with the correct code needed, or perhaps suggest another way of giving the same result?
Thanks
Anton
Hi @MichalCK,
Could you show me a code where this worked? I think I've tried all possibly options, including your suggestions but I don't seem to obtain the preferred outcome.
Thanks in advance!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Something like this?
MEMBERSET [d/CUSTOMER] = "123"
MEMBERSET [d/CUSTOMERGROUP] = "#"
MEMBERSET [d/SALESORG] = "1000"
MEMBERSET [d/MEASURE] = "Amount"
DELETE()
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @JefB
I'm struggling with a similar issue. Therefore I was very happy to read this thread and try your proposed code.
However, when that is tried, it gives the error message that the operator "/" cannot be calculated. I think the reason for that is because this is done on a dimension instead of measure.
Therefore, I was curious if you have any suggestions on how to overcome that issue?
Apologies @JefB, I've tried to code from @MichalCK and to give a snipped of what I've resulted in the error mentioned in my previous message:
This was the closest I came to trying his code.
So indeed the challenge I'm facing is that I have duplicated records where the record is once with Dimension "Deelneming" filled (anything else then "#") and once with it being "#".
However, I also have cases of Dimension "Deelneming" being "#" where it doesn't contain another value. Those cases I don't want to delete but I only want to delete the cases of the duplicate records.
Hope that makes it a bit more clear, if not please let me know what additionally I need to share to give you a better idea.
Hi @MaxT,
there is an issue in your code line 3, please try to use
IF RESULTLOOKUP() / RESULTLOOKUP([d/Deelneming] = #GROOTBOEKREKENING) < 1
User | Count |
---|---|
70 | |
10 | |
8 | |
8 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.