Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

If statements in load script

I'm new to Qlikview - at least developing scripts and I need to put in three If statements in my load script. 

The next three lines are each line I need to calculate in the script:

Effective Date + 365 days as Renewal,

Effective Date <= 365 days AND Agent First Application Date <= 365 days as First Year New Agent,

Effective Date <= 365 days AND Agent First Application Date >= 365 days as First Year Existing Agent

I read the initial code as an If statement within the load as IF(Effective Date + 365 Days, __) as Renewal - is there any values I'd put in the THEN part or do I leave that alone?

Thanks in advance.

3 Replies
MayilVahanan

Hi

     Just leave as it is..date(EffectiveDate+365) as Renewal

Can you say Effective Date <= 365 means? Any thing you compare it?

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

Sure.  The Effective Date is within a year and the First Application Date is also within a year of the first application date - resulting in a new agent.

If the First Application Date is over a year, then it's an existing agent.

MayilVahanan

Hi

Effective date and first application date are numbers?

If so, Can you provide a sample numbers?

I think, some thing like

Load * ,

Date(Effective Date+365) as Renewal,

if(Num(today()) -num(Effective Date) <= 365 AND Num(today())-num(Agent First Application Date) <= 365,'First Year New Agent',

if(Num(today()) -num(Effective Date) <= 365  AND Num(today()) -num(Agent First Application Date)>= 365,' First Year Existing Agent')) as Agents

From tableName;

Hope that helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.