Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a file of logged stopreasons for a machine. Every stop reason has a stop code.
I have a problem that some of the stop codes are not logged correctly by the operator.
I can filter out this incorrect data by comparing to other fields in the data, for example:
I know that code 100 cannot occur in machine A during setup (where machine A is under the machine column and setup is under the operation column), instead this should be code 200.
Is it possible to have qlikview change the stop code if certain conditions are fulfilled? Maybe in the script?
Hope you can understand my question=)
Thanks
Johan
Hello Johan,
If you know the correspondence between machines you can use something like the following
CorrectionMachineOperationandCodeMap:MAPPING LOAD * INLINE [MachineOperation, CorrectedCodeASetup, 200]; Original:LOAD Ceil(Rand() * 3) * 100 AS Code, Pick(Ceil(Rand() * 3), 'Setup', 'Run', 'Stop') AS Operation, Chr(64 + Ceil(Rand() * 5)) AS MachineAUTOGENERATE 100; Corrected:LOAD Code, Operation, Machine, ApplyMap('CorrectionMachineOperationandCodeMap', Machine & Operation, Code) AS CorrectedCode // Wil return the original if there's no correspondenceRESIDENT Original; DROP TABLE Original;
Hope that helps
Hi
You can try this in the script
If(Code=100 and Machine='A' and operation = 'Setup',200,Code) as Code,
Regards
Anders
Hello Johan,
If you know the correspondence between machines you can use something like the following
CorrectionMachineOperationandCodeMap:MAPPING LOAD * INLINE [MachineOperation, CorrectedCodeASetup, 200]; Original:LOAD Ceil(Rand() * 3) * 100 AS Code, Pick(Ceil(Rand() * 3), 'Setup', 'Run', 'Stop') AS Operation, Chr(64 + Ceil(Rand() * 5)) AS MachineAUTOGENERATE 100; Corrected:LOAD Code, Operation, Machine, ApplyMap('CorrectionMachineOperationandCodeMap', Machine & Operation, Code) AS CorrectedCode // Wil return the original if there's no correspondenceRESIDENT Original; DROP TABLE Original;
Hope that helps
Thank you Miguel!
It works really good!
//
Johan