Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
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
Anonymous
Not applicable
Author

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;

View solution in original post

3 Replies
Anonymous
Not applicable
Author

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;

sunny_talwar

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
Author

Thank you gentleman!  Both answers work well