Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
paulyeo11
Master
Master

How to create additional field name PNL+TYPE = Revenue IF GL_CODE=80020 ?

Hi All

My Table after load raw data to Qlik is look like below :-

SOURCEGL_CODE_GL_DESC_Amount
TDS80020LOCAL SALES205297.31
PMC5000200LOCAL SALES

-590387.65

 

I Wish to make the table as below :-

SOURCEGL_CODE_GL_DESC_AmountPNL_TYPE
TDS80020LOCAL SALES205297.31REVENUE
PMC5000200LOCAL SALES-590387.65REVENUE

 

Base on condition :- 

SOURCE = TDS , GL_CODE=80020 , PNL_TYPE = Revenue

SOURCE = PMC, GL_CODE=5000200 , PNL_TYPE = Revenue

Can some one advise me how to do it ?

PAul Yeo

SOURCE = TDS GL_CODE=80020 , PNL_TYPE = Revenue

 

1 Solution

Accepted Solutions
paulyeo11
Master
Master
Author

Hi Vegar & Jochem

Thank you very much for reply my post.

Some how this morning with clear mind , i try to check my script again , it work fine .

So i can moving on.

Paul Yeo

View solution in original post

5 Replies
jochem_zw
Employee
Employee

If(GL_CODE=‘80020’ and PNL_TYPE=‘REVENUE’,Amount,0) As RevenueAmount
Vegar
MVP
MVP

In your example all records are classed as REVENUE, in the  future I would recommend to add sample rows that is both true and false in your logic.

 

I've tried to solve your question by using applymap (See attached qvw). I hope I understood your issue correctly and that it solves your need. 

image.png

 

 

paulyeo11
Master
Master
Author

Hi Vegar & Jochem

Thank you very much for reply my post.

Some how this morning with clear mind , i try to check my script again , it work fine .

So i can moving on.

Paul Yeo

paulyeo11
Master
Master
Author

Hi Vegar

Your advise is very good. I will remember it .

Thank you

Paul
Vegar
MVP
MVP

Thank you for the nice feedback.

-Vegar