Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

group values

Hi,

I need to group values into a new filed to summarize them.

I was thinking about using function IF

the aim is to have

FIELD A= 1 or 2 or 3   FIELD B= 100

FIELD B= 4 or 5 or 6   FIELD B= 200

FIELD C= 7 or 8 or 9   FIELD B= 300

and sons...

I tried with this script but it seems to reach just the first input of each class

If (FIELD A='1' or '2' or '3', '100', If (FIELD A='4' or '5' or '6', '200', If (FIELD A='7' or '8' or '9', '300','N/A'))) as "FIELD B"

I suppose something is missing in the syntax but I don't know what!

thanks in advance

1 Solution

Accepted Solutions
Sokkorn
Not applicable

group values

Hi,

Maybe this one can help you:

If(MATCH(FIELD A,'1','2','3'), '100',

   If (MATCH(FIELD A,'4','5','6'), '200',

     If (MATHC(FIELD A,'7','8','9', '300'),'N/A'))) as [FIELD B]

Regards,

Sokkorn Cheav

2 Replies
julian_ortiz
Not applicable

group values

Hi Pastrana

Try this

If (FIELD A='1' or A='2' or A='3', '100', If (FIELD A='4' or A='5' or A='6', '200', If (FIELD A='7' or A='8' or A='9', '300','N/A'))) as "FIELD B"

Regards

Julian

Sokkorn
Not applicable

group values

Hi,

Maybe this one can help you:

If(MATCH(FIELD A,'1','2','3'), '100',

   If (MATCH(FIELD A,'4','5','6'), '200',

     If (MATHC(FIELD A,'7','8','9', '300'),'N/A'))) as [FIELD B]

Regards,

Sokkorn Cheav