Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Not applicable

Same Part in different location

Test:

LOAD * INLINE [

    pn, slc

    a, 1

    a, 1

    a, 2

    b, 3

    b, 3

    c, 4

    c, 5

];

Refer to pn as a Part Number and to slc as Store Location.

Question is: Do we have Part Numbers in different location?

This is true for a and c.

Any sugestions?

1 Solution

Accepted Solutions

Re: Same Part in different location

Hi Thomas,

This is the idea. This will work provided all values in "pn" and "slc" are ordered. If they are not, do a second resident load of the "Test" table using ORDER BY.

Test:
LOAD *, If(pn = Previous(pn), If(slc = Previous(slc), 0, 1), 0) AS DifferentLocations, RowNo() AS LineNo INLINE [
    pn, slc
    a, 1
    a, 1
    a, 2
    b, 3
    b, 3
    c, 4
    c, 5
];

That will only store "1" when the "slc" is different within the same "pn". You can now easily draw a chart showing what "pn" have different locations.

Hope that helps.

Miguel

2 Replies

Re: Same Part in different location

Hi Thomas,

This is the idea. This will work provided all values in "pn" and "slc" are ordered. If they are not, do a second resident load of the "Test" table using ORDER BY.

Test:
LOAD *, If(pn = Previous(pn), If(slc = Previous(slc), 0, 1), 0) AS DifferentLocations, RowNo() AS LineNo INLINE [
    pn, slc
    a, 1
    a, 1
    a, 2
    b, 3
    b, 3
    c, 4
    c, 5
];

That will only store "1" when the "slc" is different within the same "pn". You can now easily draw a chart showing what "pn" have different locations.

Hope that helps.

Miguel

MVP
MVP

Same Part in different location

Maybe you could just create a straight table chart with dimension pn, and

=if(count( distinct slc) >1, 1, 0)

as expression. If supress zero values is enabled in presentation tab, only the pn with 1 (true) will be shown.

Probably not the most performant solution though.