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

Announcements
Posting on Qlik Community is temporarily paused. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Chanty4u
MVP
MVP

RE;Replace...?

hi all,

i have data lik  complxcity values 2,4,8.

filedname :cmplexity

and i want to replce  2 as simple, 4 as expect, 8 as common

how can i achive in script?

thnks in advance...

Labels (1)
1 Solution

Accepted Solutions
Anonymous
Not applicable

like this?

if(Complexity=2, 'Simple',

if(Complexity=4, 'Expect',

if(Complexity=8, 'Common'))) as NewField

View solution in original post

7 Replies
sunny_talwar
MVP
MVP

May be this:

Pick(Match(cmplexity, 2, 4, 8), 'simple', 'expect', 'common')

Anonymous
Not applicable

like this?

if(Complexity=2, 'Simple',

if(Complexity=4, 'Expect',

if(Complexity=8, 'Common'))) as NewField

Kushal_Chawda
MVP
MVP

=Pick(Match(cmplexity,'2', '4','8'), 'simple', 'expect', 'common') as Complexity_new

HirisH_V7
Master
Master

Hi ,

Like this,

T:

REPLACE ONLY LOAD * INLINE [

    Type, Value

    Simple, 2

    Expect, 4

    Common, 8

   ];

T:

LOAD * INLINE [

    Type

    Simple

    Expect

    Common and Other

];

It Helps for large data sets,

Replace.PNG

Hope this Helps,

Hirish

HirisH
sunny_talwar
MVP
MVP

On similar lines:

=Dual(Pick(Match(cmplexity, 2, 4, 8), 'simple', 'expect', 'common'), cmplexity) as cmplexity

This avoid having two fields telling the same story

Chanty4u
MVP
MVP
Author

thnx all...all r wrkng fyn...i used If cndition

Chanty4u
MVP
MVP
Author

nice hirish