Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Melon_96
Contributor
Contributor

Create a new attribute from current attributes

Hello to everybody!

 

I am new in Qlik Sense and I have a question, I hope you can help me.

 

Right now I have a table named Product. In the Product table I have an attribute named Stock. This stock is going to be updated everyday and it has to options. The value of the stock can be Yes or Not. My goal is to create a new attribute in the table Product where if the value of stock is Yes the value of the new attribute is 1 and 0 if the value of stock is Not.

 

Is it possible to create that new attribute from the table itself? If so, how can I create that new attribute?

 

Thank you very much in advanced!

1 Solution

Accepted Solutions
dplr-rn
Partner - Master III
Partner - Master III

Maybe i am misunderstanding some underlying complexity.

but typical way to do this is like below

https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/ConditionalFun...

load attr1,
     . //Other columns/attributes
     ,
     Stock,
     if(Stock = 'Yes',1,0) as StockFlag
;
sql
load * from ProductTable;

View solution in original post

3 Replies
dplr-rn
Partner - Master III
Partner - Master III

Maybe i am misunderstanding some underlying complexity.

but typical way to do this is like below

https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/ConditionalFun...

load attr1,
     . //Other columns/attributes
     ,
     Stock,
     if(Stock = 'Yes',1,0) as StockFlag
;
sql
load * from ProductTable;
Melon_96
Contributor
Contributor
Author

Thank you very much, problem solved!

dplr-rn
Partner - Master III
Partner - Master III

Mark the answer as solution please