Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Good morning/evening. I am trying to determine from the attached file where ECM has multiple Material and those respective material have different lead times. I would like to develop script for an expression to determine based on lead time for that ECM what is the highest lead time. Since there are duplicates of the highest number for now it doesn't matter.
Sure, I don't know what is the correct name of your table
In my example it is Table. In your case - whatever you named it.
I dont see an attached file. Can you please re-attach it.
ECM | Material | Lead time |
479894RXAERO | ETN19316 | 0 |
479894RXAERO | ETN93329 | 0 |
479894RXAERO | RE337399 | 8 |
479894RXAERO | RE556399 | 8 |
479894RXAERO | RE563774 | 8 |
479894RXAERO | RE572010 | 4 |
479894RXAERO | RE572011 | 4 |
479894RXAERO | RE572012 | 4 |
Maybe like attached. I created a field called RequiredFlag on the backend.
1 corresponds to all the materials for a particular ECM with max Lead Time
Hope it helps.
Thanks
AJ
If in the script:
load
ECM,
max("Lead time") as MaxLeadTime
RESIDENT...
GROUP BY ECM;
If on the front end:
ECM is dimension, and the expression is max("Lead time")
I am only using the personal addition so need the script not a QVW.
Table:
LOAD ECM,
Material,
[Lead time]
FROM
Data Source;
Left Join
Load ECM,Max([Lead time]) as Flag
Resident Table
Group by ECM;
Test:
Load *, If([Lead time]=Flag,1,0) as RequiredResult
Resident Table;
Drop Table Table;
getting an error for the invalid expression. I am adding another line in the script. I have also renamed the field Lead time to Prod Proc LT. the expression needs to have a rank? so I want 1.
max([PROD PROC LT],1) as Maxprodlt
Rank is optional, most likely you don't need it.
As for the error - can you show this portion of the script? Or upload the app (not too large please)?
LOAD
Left(ECM,6) as [AE PMR ECM LCL],
ECM as [AE PMR ECM],
MATERIAL,
[PROD PROC LT] as [AE PMR PROD PROC LT],
Max([PROD PROC LT],1) as Maxprodlt,
Sorry I am not very versed in scripting development. So just to be clear I am wanting a variable that I can use. Typically I use list or table boxes so my intentions were that I have multiple ECM's and I was going to create a table that has the ECM and this new variable with the max Prod Proc LT. so it would look like this
ECM | MaxLeadtime |
479894RXAERO | 8 |