Discussion Board for collaboration on QlikView Scripting.
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.
Solved! Go to Solution.
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.
If in the script:
max("Lead time") as MaxLeadTime
GROUP BY ECM;
If on the front end:
ECM is dimension, and the expression is max("Lead time")
Load ECM,Max([Lead time]) as Flag
Group by ECM;
Load *, If([Lead time]=Flag,1,0) as RequiredResult
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)?
Left(ECM,6) as [AE PMR ECM LCL],
ECM as [AE PMR ECM],
[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