Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

MVP
MVP

Re: Grouping issue with file

Andrew Thomas wrote:

THe DISTINCT logic worked to the point where it gave me 1 record for open and 1 for closed against the same OBJNR

That's correct. You did not specify that you want suppress the open if there are any closes...

This will prevent loading open if any close states exist.

JESTPR:

LOAD DISTINCT

OBJNR As JestOBJNR,

'Closed' As OpenState

FROM (qvd)

WHERE STAT <> 'I0046';

Concatenate

LOAD DISTINCT

OBJNR As JestOBJNR,

'Open' As OpenState

FROM (qvd)

WHERE STAT = 'I0046' AND Not(Exists(JESTPR));

WHERE STAT = 'I0046' AND Not(Exists(OBJNR ));

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
MVP
MVP

Re: Grouping issue with file

JESTPR:

LOAD DISTINCT

OBJNR As JestOBJNR,

'Closed' As OpenState

FROM (qvd)

WHERE STAT <> 'I0046';

Concatenate

LOAD DISTINCT

OBJNR As JestOBJNR,

'Open' As OpenState

FROM (qvd)

WHERE STAT = 'I0046' AND Not(Exists(JestOBJNR, OBJNR));

(Finally got that right!)

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable

Re: Grouping issue with file

Thank you that worked