Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
IMPORTANT: Upcoming LEF Database Maintenance, Oct. 3rd - SEE DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator III
Creator III

How can we create another field combining two fields?

Hello, 

I have created the below filter;

If(Cost_Code = '3', 'Mechanical Engineering',
If(Cost_Code = '4', 'Controls Engineering')) as Engineering_Area

 I am trying to combine both '3' and '4' to get the Total as another field in Engineering_Area. 

Can anyone please help me how to do this? I have attached the script in the qvd file. 

Labels (3)
1 Solution

Accepted Solutions
Highlighted

Maybe create a link table like this

LinkTable:
LOAD DISTINCT Engineering_Area,
	 Engineering_Area as New_Engineering_Area
Resident Project_Cost2
Where Len(Trim(Engineering_Area)) > 0;

Concatenate (LinkTable)
LOAD DISTINCT Engineering_Area,
	 'Total' as New_Engineering_Area
Resident Project_Cost2
Where Len(Trim(Engineering_Area)) > 0;

and now the New_Engineering_Area will have a new value called 'Total'

image.png

View solution in original post

13 Replies
Highlighted
Champion III
Champion III

Can you let us know your expected output you want to see in your Engineering_Area field? And your qvw file is failing and unable to open it. 

Highlighted


@bhaveshp90 wrote: 
I am trying to combine both '3' and '4' to get the Total as another field in Engineering_Area. 

Can you elaborate on what exactly do you mean by this?

Highlighted
Creator III
Creator III

Hi @sunny_talwar,  I am trying to add Total (Cost_Code = '3' and Cost_Code = '4') to Engineering_Area. 

So that my Engineering_Area has three fields; Mechanical Engineering, Controls Engineering, and Total. 

Highlighted
Creator III
Creator III

@vishsaggi I want to Add Total to my Engineering_Area; where Total = (Cost_Code ='3' + Cost_Code = '4')

1.PNG

 

 

 

I've attached the file again now. 

Highlighted
Champion III
Champion III

Did you replaced the file onto your first thread or did you missed attaching. I do not see the qvw file attached.
Highlighted
Creator III
Creator III

@vishsaggi please find the attachment here, I've attached in my question but I don't know why you are unable to see it. 

Highlighted
Champion III
Champion III

Ok your Cost_Code field has two values 3 and 4 when you say you want total what should happen when you select total. As at a time either you will have costcode 3 or 4 not both right?
Highlighted
Creator III
Creator III

@vishsaggi I am trying to make Area as a filter in my report;

When I select Total it should show both values Sum(Cost_Code = 3 + Cost_Code =4)

My Area should have 3 fields I can select = Cost_Code =3, Cost_Code =4, Sum(Cost_Code = 3 + Cost_Code =4)


1.PNG

 

Highlighted
Creator III
Creator III

@sunny_talwar Can you please help me with this problem?