Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
nevilledhamsiri
Specialist
Specialist

Combining codes together & present the value adding both MO & NM

Dear Friends

If I am to combine both codes define for MO & NM together & to present value adding both, how it is done both at script level & front end. Also if the serial of the codes end with 1 such as 171,191 etc, I need to give a function to pick all codes ends with 1 as Motor Codes. Also this should be only from  seventy code series such as 77151,

Thanks in advance

1 Solution

Accepted Solutions
vamsee
Specialist
Specialist

Script:

LOAD
*,
SubField(TYPE, '-',1) as Combined_Type,
IF(Left(CODE,1)=7, IF(Right(CODE,1)=1, 'Yes','No'),'No') as Motor_Code;
LOAD TYPE, CODE, VALUE
FROM (ooxml, embedded labels, table is Sheet1);

UI:

Combined Type Dimension: Text(Trim(SubField(TYPE, '-',1)))

Motor Code Dimension: IF(Left(CODE,1)=7,IF(Right(CODE,1)=1,'Yes', 'No'),'No')

You can create the same dimensions as columns in the script.

View solution in original post

6 Replies
nevilledhamsiri
Specialist
Specialist
Author

Refer the attachment

vamsee
Specialist
Specialist

Please find the attached and let me know if it matches your requirement.

vamsee
Specialist
Specialist

Created two more charts for visualizations.

PFA.

nevilledhamsiri
Specialist
Specialist
Author

Hi Vamsee

Sorry for the delay in response as I was away from home. Could you please send me your working typed in the body of the reply the fact is that I cannot open your answer. I am using a personnel edition of qlik view.

Thanks

Neville

vamsee
Specialist
Specialist

Script:

LOAD
*,
SubField(TYPE, '-',1) as Combined_Type,
IF(Left(CODE,1)=7, IF(Right(CODE,1)=1, 'Yes','No'),'No') as Motor_Code;
LOAD TYPE, CODE, VALUE
FROM (ooxml, embedded labels, table is Sheet1);

UI:

Combined Type Dimension: Text(Trim(SubField(TYPE, '-',1)))

Motor Code Dimension: IF(Left(CODE,1)=7,IF(Right(CODE,1)=1,'Yes', 'No'),'No')

You can create the same dimensions as columns in the script.

nevilledhamsiri
Specialist
Specialist
Author

Thanks Vamsee,

This is what I needed

Neville