Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have loaded some columns in Qlik Sense Desktop which are:
Segment has values like Home and Entertainment.
I want to create another column where the columns is named "Home" and the values are from Transaction Value IF the Segment contains Home. Hopefully this table makes it clear.
Segment | Transaction Value | Home (new column) |
| |
---|---|---|---|---|
Home | $100 | $100 | ||
Entertainment | $200 | $200 | ||
Entertainment | $300 | $300 | ||
Home | $400 | $100 |
Any help here would be appreciated.
Try this:
LOAD "Date",
Description,
"Short Description",
Segment,
"Sub Segment",
"Transaction Value",
If(Segment = 'Home', "Transaction Value") as Home
If(Segment = 'Entertainment', "Transaction Value") as Entertainment
FROM Source;
In your Home field put :
if(Segment='Home',[Transaction Value],'')
Try this:
LOAD "Date",
Description,
"Short Description",
Segment,
"Sub Segment",
"Transaction Value",
If(Segment = 'Home', "Transaction Value") as Home
If(Segment = 'Entertainment', "Transaction Value") as Entertainment
FROM Source;
You can create extra fields in the script as Sunny showed above. You can also use three expressions in a straight table with Segment as dimension:
Thanks Sunny,
This worked perfectly. You're a legend.
Thanks Gysbert,
This seems to work as an alternative as well. Appreciate your help as well.
Thanks a lot
Delzad