Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator III
Creator III

How to write script for the given condition?

Hello,

I have created a backend script for my filter as;

If(Code = '3', 'Mechanical',

If(Code = '4', 'Controls',

If(Code = '5', 'System'))) as Engineering,

But I want to create another condition combining Code = '3', Code = '4', Code = '5' as Total in the same Engineering Category.

Any idea on how to do this?

thanks

Bhavesh

1 Solution

Accepted Solutions
Highlighted

Concatenate to the above table

LOAD 'Total' as Engineering

from ...

where Match(Code, 3, 4, 5);

View solution in original post

2 Replies
Highlighted

Concatenate to the above table

LOAD 'Total' as Engineering

from ...

where Match(Code, 3, 4, 5);

View solution in original post

Highlighted
Creator III
Creator III

thank you stalwar1‌,  I have now Total added as another condition for my filter "Engineering". But the Expression for my Sales is not filtering. This is how my expression is;


=if(Code = '3', Sum(Sales_3),

if(Code = '4', Sum(Sales_4),

if(Code = '5', Sum(Sales_5))))

//Script:

y:

NoConcatenate Load

*,   

If(Code = '3', 'Mechanical',

If(Code = '4', 'Controls',

If(Code = '5', 'System'))) as Engineering,

Resident x;


Left Join (y)

Load

if(Cost_Code = '3', Sales,0) as Sales_3,

if(Cost_Code = '4', Sales,0) as Sales_4,

if(Cost_Code = '5', Sales,0) as Sales_5,

Resident y

LOAD

'Total' as Engineering

Resident y

where Match(Code, 3, 4, 5);


Can you tell me what is wrong here? thanks