Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Set attribute

Hi all,

I want to use a function which treat all docnumbers as IC-Type, when a single item in a document number has the type IC.

For example I have this data:

Docnumber, Item, Type

1,1,IC

1,2,#N/A

1,3,3rd

2,1,#N/A

2,2,3rd

2,3,#N/A

Now all Items of Docnumber 1 should be treated as IC-Type, because one Item is equal to type IC.

Thanks!

KR

Joe

1 Solution

Accepted Solutions

Re: Set attribute

Hi,

maybe helpful:

QlikCommunity_Thread_217194_Pic1.JPG

QlikCommunity_Thread_217194_Pic2.JPG

QlikCommunity_Thread_217194_Pic3.JPG

QlikCommunity_Thread_217194_Pic4.JPG

tabDocItems:

LOAD * INLINE [

    Docnumber, Item, Type

    1, 1, IC

    1, 2, #N/A

    1, 3, 3rd

    2, 1, #N/A

    2, 2, 3rd

    2, 3, #N/A

];

tabDocTypes:

LOAD Distinct

    Docnumber,

    Type as DocType

Resident tabDocItems;

Generic

LOAD Docnumber,

    DocType,

    'yes'

Resident tabDocTypes;

regards

Marco

5 Replies

Re: Set attribute

May be create a new column where you assign IC to all the repeating Docnumber

Table:

LOAD * Inline [

Docnumber, Item, Type

1,1,IC

1,2,#N/A

1,3,3rd

2,1,#N/A

2,2,3rd

2,3,#N/A

];

Left Join (Table)

LOAD Docnumber,

  'IC' as NewType

Resident Table

Where Type = 'IC';


Capture.PNG

Re: Set attribute

Hi,

maybe helpful:

QlikCommunity_Thread_217194_Pic1.JPG

QlikCommunity_Thread_217194_Pic2.JPG

QlikCommunity_Thread_217194_Pic3.JPG

QlikCommunity_Thread_217194_Pic4.JPG

tabDocItems:

LOAD * INLINE [

    Docnumber, Item, Type

    1, 1, IC

    1, 2, #N/A

    1, 3, 3rd

    2, 1, #N/A

    2, 2, 3rd

    2, 3, #N/A

];

tabDocTypes:

LOAD Distinct

    Docnumber,

    Type as DocType

Resident tabDocItems;

Generic

LOAD Docnumber,

    DocType,

    'yes'

Resident tabDocTypes;

regards

Marco

Not applicable

Re: Set attribute

Thanks! It works now perfectly.

Not applicable

Re: Set attribute

Hi Sunny!

This should also work, but I took the proposal from Marco.

Thanks for your effort!

Re: Set attribute

Not a problem, as long as you get what you were looking for

Community Browser