Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
QLIKWORLD LIVE! MAY 16 - 19TH, EARLY BIRD DISCOUNTS! REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
Poppel
Contributor II
Contributor II

Create new column when loading data if a value in the column fulfil a certain condition

Hi,

I have a sheet looking like this:

 

Region | People| Number

JAPAN          Boy             10

JAPAN          Girl             20

JAPAN          Total           30

 

Is it possible to create a new column when loading the sheet to make the result look like this:

Region | People| Number| Total_Number

JAPAN      Boy             10                30

JAPAN       Girl             20                30

 

I was thinking something like :  IF([People], 'Total') AS [Total Number], but it didn't work.

Cheers,

Poppel

Labels (2)
1 Solution

Accepted Solutions
jatishqv
Partner
Partner

Hi 

You can try this.

Data_Temp_1:
LOAD * INLINE [
    Region, People, Number
    JAPAN, Boy, 10
    JAPAN, Girl, 20
    JAPAN, Total, 30
];

Data:
NoConcatenate
LOAD Region,
	 People,
	 Number
Resident Data_Temp_1
Where People <> 'Total';

Join (Data)
LOAD Region,
	 Number as Total_Number
Resident Data_Temp_1
Where People = 'Total';

Drop Table Data_Temp_1; 

View solution in original post

3 Replies
Ezir
Creator II
Creator II

Hi @Poppel 

If this new column is an aggregation I suggest creating expression in dashboard.

To tell you the truth... I don't really fully understand the issue at hand.... If you can give another example🤔

jatishqv
Partner
Partner

Hi 

You can try this.

Data_Temp_1:
LOAD * INLINE [
    Region, People, Number
    JAPAN, Boy, 10
    JAPAN, Girl, 20
    JAPAN, Total, 30
];

Data:
NoConcatenate
LOAD Region,
	 People,
	 Number
Resident Data_Temp_1
Where People <> 'Total';

Join (Data)
LOAD Region,
	 Number as Total_Number
Resident Data_Temp_1
Where People = 'Total';

Drop Table Data_Temp_1; 
Poppel
Contributor II
Contributor II
Author

Hi @jatishqv 

Made it. Not with the exact syntax but with the same logic.

Thanks bunch! 🌻