Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Multiple if statements in Edit script

I have 2 columns Gross revenue and net revenue and 3rd column customer type where some charater values are there. I need to create new gross and new net columns based on some condition using customer type. How can i use multiple if statement in edit script for this? Any help appreciated

16 Replies
Not applicable
Author

Hi Jagan,

I dont know why but for some reason this syntax is only copying for Gross for Indirect customers. For Direct customers and for some other conditions i have the gross is still showing 0.

Regards,

Mallik

Not applicable
Author

Hi Shyamal,

I dont know why but for some reason this syntax is only copying for Gross for Indirect customers. For Direct customers and for some other conditions i have the gross is still showing 0.

Regards,

Mallik

Not applicable
Author

Hi Nirmal,

I dont know why but for some reason this syntax is only copying for Gross for Indirect customers. For Direct customers and for some other conditions i have the gross is still showing 0.

Regards,

Mallik

Not applicable
Author

Hi Tresesco,

I dont know why but for some reason this syntax is only copying for Gross for Indirect customers. For Direct customers and for some other conditions i have the gross is still showing 0.

Regards,

Mallik

tresesco
MVP
MVP

Check these:

If the parenthesis are proper, or comparison string/field name is correct.  Or, you might want to share a sample app.

Not applicable
Author

You can check for the paranthesis or post a sample app, so it would be easier to pin point the issue.

Not applicable
Author

YOU CAN ACHIEVE THIS IN TWO STEP-

during 1st load-

LOAD

*,

If( [Customer type] = 'Indirect', 1,0) as GrossF1,

If([Custmer type] = 'direct' and [Book Type]='Standard' and [Action type]='Fixed', 1,0) as GrossF2



during 2nd load take resident of above table and try below code

load *,

if(GrossF1=1 or GrossF2=1,Gross) as new gross



hope this will help