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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
nvijay5757
Creator
Creator

Replace values

Hi,

my data looks like

Modes KD
8.0ANC nKD
10.0AOR KD
8.0AB KD
8.0AB nKD
12.0AB KD
16.0AB KD
22.0AB nKD
25.0AB nKD
25.0AB nKD
35.0AB nKD
35.0AB KD
35.0AB nKD

 

some Modes in KD column receiving two values like KD and nKD for that will replace to KD.

ex: 8.0AB have KD and nKD ->  nKD will replace to KD.   similarly,

35.0AB have KD and nKD ->  nKD will replace to KD.

help me thanks.

Labels (3)
12 Replies
PrashantSangle

try below code.

Table:
Load *, RecNo() as RecId Inline [
Modes, KD
8.0ANC, nKD
10.0AOR, KD
8.0AB, KD
8.0AB, nKD
12.0AB, KD
16.0AB, KD
22.0AB, nKD
25.0AB, nKD
25.0AB, nKD
35.0AB, nKD
35.0AB, KD
35.0AB, nKD
];
Left Join (Table)
LOAD
Modes,
FirstValue(KD) as KDNew
Resident Table
Group By Modes
Order By KD
;
Left Join (Table)
Load Modes,
count(Modes) as mode_cnt,
count( DISTINCT KD) as KD_cnt
Resident Table
Group by Modes;

NoConcatenate
Final:
Load RecId,Modes,KD,KDNew,if(mode_cnt>1 and KD_cnt >1 and KD='nKD',' ',KD) as KDNew1,mode_cnt,KD_cnt
Resident Table
;

Drop Tables Table;

 

Regards,

Prashant Sangle

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
nvijay5757
Creator
Creator
Author

Hi, yes exactly.

like the input and output.

Input   Output
Modes KD   Modes KDnew
8.0ANC nKD   8.0ANC nKD
10.0AOR KD   10.0AOR KD
8.0AB KD   8.0AB KD
8.0AB nKD   8.0AB  
12.0AB KD   12.0AB KD
16.0AB KD   16.0AB KD
22.0AB nKD   22.0AB nKD
25.0AB nKD   25.0AB nKD
25.0AB nKD   25.0AB nKD
35.0AB nKD   35.0AB  
35.0AB KD   35.0AB KD
35.0AB nKD   35.0AB  
PrashantSangle

check my above solution

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂