Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Ashti
Contributor
Contributor

Deriving a new column

Hi 

I have a table with just Id, Items and orderedby.

How would I derive Type colum.

I tried wildmatch, it ends up giving ID 3 - online .

 

ID  Items Orderedby Type
1 Fruits Mobile Online
1 Vegetables laptop Online
1 Clothes NA Online
2 Laptop laptop Online
2 Clothes NA Online
3 Accessories NA NA
Labels (5)
4 Replies
BrunPierre
Partner - Master
Partner - Master

What is the logic behind creating a new column?

Ashti
Contributor
Contributor
Author

if orderedby is anything but NA then "ONLINe" else NA

since ID 1 has online and Na..wildmatch returns online and NA..i just need Online for Id 1 and 2

vinieme12
Champion III
Champion III

if  you are trying to create this in a chart then try below

=if(MaxString(Total <ID> OrderedBy)='NA','NA','Online')

 

In Script as below

Main:

Load ID,Items,OrderedBy

From SomeSource;

Left Join(Main)

Load ID,if(MaxString(OrderedBy)='NA','NA','Online') as Type

Resident Main

Group by ID;

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Ashti
Contributor
Contributor
Author

It works fine in chart but not in load script.

In chart the problem is I need to use it as a filter and since we are using max function it doesnt show up as its a measure.

Load script still shows as online and NA for an ID 1