Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Read about the latest Qlik Community enhancements on the Community News blog!
cancel
Showing results for 
Search instead for 
Did you mean: 
gireesh1216
Creator II
Creator II

Need Help on calculating Column

Hello Team,

Please help me on below scenario. 

we have raw data like below:

IDNAMEDSTATUS
1216GIREESHD1PASS
1216GIREESHD2 
1216GIREESHD3 
1216GIREESHD4 
1217NARESH FAIL
1217NARESHD5 
1217NARESHD6 
1217NARESHD7 

 

Result: Need STATUS as New Status column if ID and NAME is same.

IDNAMEDSTATUSNew Status
1216GIREESHD1PASSPASS
1216GIREESHD2 PASS
1216GIREESHD3 PASS
1216GIREESHD4 PASS
1217NARESH FAILFAIL
1217NARESHD5 FAIL
1217NARESHD6 FAIL
1217NARESHD7 FAIL
1 Solution

Accepted Solutions
jonathandienst
Partner
Partner

Use this pattern:

DATA:
LOAD ID, NAME, D, STATUS as TSTATUS
FROM ....;

JOIN(DATA)
LOAD ID, NAME, TSTATUS as STATUS
WHERE Len(TSTATUS) > 0;

DROP Field TSTATUS;

This assumes that there is never more than one instance of ID and NAME with a status. If that is not a safe assumption, then use this for the join instead:

JOIN(DATA)
LOAD ID, NAME, MaxString(TSTATUS) as STATUS
WHERE Len(TSTATUS) > 0
GROUP BY ID, NAME;

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

View solution in original post

2 Replies
Anil_Babu_Samineni

Answer here - https://community.qlik.com/t5/QlikView-App-Development/Need-Help/m-p/1658776/highlight/false#M448554

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
jonathandienst
Partner
Partner

Use this pattern:

DATA:
LOAD ID, NAME, D, STATUS as TSTATUS
FROM ....;

JOIN(DATA)
LOAD ID, NAME, TSTATUS as STATUS
WHERE Len(TSTATUS) > 0;

DROP Field TSTATUS;

This assumes that there is never more than one instance of ID and NAME with a status. If that is not a safe assumption, then use this for the join instead:

JOIN(DATA)
LOAD ID, NAME, MaxString(TSTATUS) as STATUS
WHERE Len(TSTATUS) > 0
GROUP BY ID, NAME;

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

View solution in original post