Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Scripting Issue

Hi All,

I have a table as shown below:

AB
A11
A22
A21
A32

Now wherever I have both values as 1 and 2 in column B for a particular value of column A, then it should be stored as 3.

The below table should be created in script.

AB
A11
A23
A3

2

Can someone please help me in implementing the above scenario?

4 Replies
Gysbert_Wassenaar

LOAD

     A,

     sum(B) as B

FROM ...sourcetable...

GROUP BY A;


talk is cheap, supply exceeds demand
PrashantSangle

Hi,

try something like below

t1:
LOAD * INLINE [
    A,B
    A1,1
    A2,1
    A2,2
    A3,2
];

load A,if(A='A2' and match(B,'1','2'),'3',B) as new_B
Resident t1;

Regards

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 🙂
sunny_talwar

PFA

Table:

LOAD A,

    B

FROM

[https://community.qlik.com/thread/161172]

(html, codepage is 1252, embedded labels, table is @1);

Table1:

NoConcatenate

LOAD A,

  Sum(B) as B

Resident Table

Group By A;

DROP Table Table;

Best,

Sunny

Not applicable
Author

PFA