Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

sureshqv
Esteemed Contributor III

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...

Tags (3)
1 Solution

Accepted Solutions
balrajahlawat
Esteemed Contributor

Re: RE;Replace...?

like this?

if(Complexity=2, 'Simple',

if(Complexity=4, 'Expect',

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

7 Replies

Re: RE;Replace...?

May be this:

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

balrajahlawat
Esteemed Contributor

Re: RE;Replace...?

like this?

if(Complexity=2, 'Simple',

if(Complexity=4, 'Expect',

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

Re: RE;Replace...?

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

hirishv7
Honored Contributor

Re: RE;Replace...?

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

Re: RE;Replace...?

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

sureshqv
Esteemed Contributor III

Re: RE;Replace...?

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

sureshqv
Esteemed Contributor III

Re: RE;Replace...?

nice hirish

Community Browser