Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
DavidJG
Contributor III
Contributor III

Just pick the first name from field in a table

Hi, 

As a new user I can't seem to find a solution to my problem. Product has a unique number, so this is used as a dimension, but one number can have different names (with a prefix, different translations and so on). I have an idea how to remove names with a certain prefix but I do not really care about which name to display in my table. Like just pick the first name. The problem for me comes with handling string values instead of numbers. 

So my data looks like this

product noname
1Thing
1Thing -Free
1ThInG
2OneMore
2OneMore -Free

 

And i want something like this

product noname
1Thing
2OneMore

 

This is probably a simple problem but I would appreciate  the help.

1 Solution

Accepted Solutions
QFabian
MVP
MVP

Hi @DavidJG , please try this example and see if it is a solution for your question.

DataX:
Load * INLINE [
ProductNo, Name
1, Thing
1, Thing -Free
1, ThInG
2, OneMore
2, OneMore -Free
];

DataFinal:
Load distinct
ProductNo
Resident DataX;

left join
Load
if(rowno() = 1, ProductNo, if(ProductNo = Previous(ProductNo),null(), ProductNo)) as ProductNo,
Name as Name
Resident DataX

;

drop table DataX;

QFabian

View solution in original post

1 Reply
QFabian
MVP
MVP

Hi @DavidJG , please try this example and see if it is a solution for your question.

DataX:
Load * INLINE [
ProductNo, Name
1, Thing
1, Thing -Free
1, ThInG
2, OneMore
2, OneMore -Free
];

DataFinal:
Load distinct
ProductNo
Resident DataX;

left join
Load
if(rowno() = 1, ProductNo, if(ProductNo = Previous(ProductNo),null(), ProductNo)) as ProductNo,
Name as Name
Resident DataX

;

drop table DataX;

QFabian