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

If statement in Load script

Hi Guys,

I have a scenario here:

Our client Fiscal Year start from Apr to March. So we are loading data month wise. We have Year column and we don't have month column in the table. But we have columns like cost1, cost2 , cost3 which are month related column. So I am taking cost 1 as month 1 , cost 2 as month 2 and so on.  The actual output i need is when month is 1 or 2 or 3 the year should remain as previous year. For example I am loading Jan 2014 data but it should show Jan 2013 only as it comes under Fiscal Year 2013. I want to achieve this in Load script.

For this I did as Select IF(Month in (1,2,3), YEAR-1, YEAR) as Year but its failing.

Please let me know how can i do this. Thanks in advance.

Best Regards,

Shankar.

2 Replies
Not applicable
Author

Hi Uma, try this

IF(Match(Month,1,2,3),YEAR-1,YEAR) AS YEAR

Hope it helps

Regards,

yura_ratu
Partner - Creator II
Partner - Creator II

Read this post Fiscal Year  to get ideas how to handle Fiscal year in Qlikview