Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Copy lowest value found in a field based on another field

Here's my question folks.

Thank you in advance

 

1 Solution

Accepted Solutions
michael_gardner
Contributor III

Re: Copy lowest value found in a field based on another field

Something like this maybe:

TempTable:

LOAD

Field1,

Field2

From ;

MinMap:

Mapping Load:

Min(Field1) as Field1,

Field2

Resident TempTable Group By Field2;

NoConcatenate

Table:

LOAD

IF(Field1 = "NoData",ApplyMap('MinMap',Field1),Field1) as Field1

Field2

Resident TempTable;

Drop TempTable;

3 Replies
michael_gardner
Contributor III

Re: Copy lowest value found in a field based on another field

Something like this maybe:

TempTable:

LOAD

Field1,

Field2

From ;

MinMap:

Mapping Load:

Min(Field1) as Field1,

Field2

Resident TempTable Group By Field2;

NoConcatenate

Table:

LOAD

IF(Field1 = "NoData",ApplyMap('MinMap',Field1),Field1) as Field1

Field2

Resident TempTable;

Drop TempTable;

Re: Copy lowest value found in a field based on another field

Checkout this script:

Table:

LOAD * Inline [

Field1, Field2

    , Group1

0013, Group1

0012, Group1

  , Group2

0015, Group2

0014, Group2

];

Join(Table)

LOAD Field2,

  Min(Field1) as Min

Resident Table

Group By Field2;

FinalTable:

LOAD If(Len(Trim(Field1)) = 0, Min, Field1) as Field1,

  Field2

Resident Table;

DROP Table Table;

Output in a chart where I am doing a count on Field1:

Capture.PNG

Not applicable

Re: Copy lowest value found in a field based on another field

Thank you gentleman!  Both answers work well

Community Browser