Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
psk180590
Creator III
Creator III

Generate New Column based on other column

Hello All,

I'm pulling some data from a DB as in the below format, and would like to generate a new filed based on the data i have.

Sample Table:

Product     ArtikelNr.
A1
A2
A5
A10
B15
B20
B30
D50
G80
F20
C30
E50

Expected Result:

Product     ArtikelNr.   Percentage
A170
A270
A570
A1070
B1570
B2070
B3070
D5070
G8085
F2085
C3070
E5085

So, basically if the Product is A, B, C, D i would like to populate the Percentage column as 70 and for all the other Products i would want 85.

Please, suggest the best possible way. Already tried doing Inline Load but, doesn't seem to work some how.

Thanks!!

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Load

          Product,

          ArtiKelNr,

          If(Match(Product, 'A','B','C','D'), 70, 85) as Percentage

View solution in original post

4 Replies
tresesco
MVP
MVP

Load

          Product,

          ArtiKelNr,

          If(Match(Product, 'A','B','C','D'), 70, 85) as Percentage

Anil_Babu_Samineni

Perhaps this?

If(Match(Product, 'A','B','C','D'), 70, 85) as Column_New

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable

Hi Sai Kumar,

Use the below expression.

=if(match(Product,'A','B','C','D'),70,85)

psk180590
Creator III
Creator III
Author

Thanks All, worked perfectly!!