Skip to main content
Announcements
Qlik Community Office Hours - Bring your Ideation questions- May 15th, 11 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

adding sufixes

hi,

i have few values in list box as below:

Names
India
Bangalore
Cochin
India

Hyderabad

Pune
Mumbai
Pune
Mumbai

as seen in the list box, there are duplicates like india, pune and mumbai so i need only these three names to be suffixed by India_S, Pune_S, and Mumbai_S

so my list box will be like this :

Names
India
Bangalore
Cochin

India_S

Hyderabad
Pune
Mumbai
Pune_S
Mumbai_S

please help

Regards

srujana

10 Replies
sunny_talwar

So the second instances of India should be renamed to India_S? how about the third or 4th instance?

Anonymous
Not applicable
Author

Hi,

like this?

DATA:

LOAD * Inline [

CITTA

India

Bangalore

Cochin

India

Hyderabad

Pune

Mumbai

Pune

Mumbai

];

NoConcatenate

DATA_2:

LOAD

CITTA

Resident DATA

Order BY CITTA;

DROP Table DATA;

NoConcatenate

DATA_3:

LOAD

CITTA,

IF(Previous(CITTA)=CITTA, CITTA&'_S', CITTA) AS CITTA_NEW

Resident DATA_2;

drop Table DATA_2;

Not applicable
Author

no i dont have 3rd and 4th instance lie that..they r repeating twice only.....

marcus_sommer

Perhaps it's better to remove the duplications maybe per mapping.

- Marcus

Not applicable
Author

i cant remove the duplicates as i need to show like that. and i cant use an inline load as  well. as i have only these three names duplciate and i need to add suffix _S . Is there any expression can we write anything.

Anonymous
Not applicable
Author

I use an inline because I don't have your data source...

Do you need an expression for the front end?

marcus_sommer

With removing the duplications within the listbox wasn't meant to remove the data behind them else only to clean the listbox-field. Normally there shouldn't be such duplications - and even if you want to keep them you will need why they exists and which from these values should be flagged with an addtional 'S' to find a stable solution.

- Marcus

MarcoWedel

Hi,

maybe one solution could be:

QlikCommunity_Thread_243075_Pic1.JPG

LOAD Names&If(Exists(Names),'_S') as Names

FROM [https://community.qlik.com/thread/243075] (html, codepage is 1252, embedded labels, table is @1);

(you would replace the inline load with your actual load statement)

hope this helps

regards

Marco

Not applicable
Author

thank u for helping me.

the duplicates are coming from say for example i have a reqwuirement like:

if (flag = 'XYZ', then append _S to India, Pune and Mumbai)

so how can i achieve this on the front end side.