Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Domino1
Contributor II
Contributor II

How to calculate future fiscal year dates in load script ?

 Here is my expression :

vFY0 = 2023  , vFY1 = 2024 , vFY2 = 2025 .....

vMonthNumber = 09


If(Sum({<[Fiscal Year]={'$(vFY0)'},$(vMonthNumber)>} SALES),
If(Sum({<[Fiscal Year]={'$(vFY1)'},$(vMonthNumber)>} SALES),
If(Sum({<[Fiscal Year]={'$(vFY2)'},$(vMonthNumber)>} SALES),
If(Sum({<[Fiscal Year]={'$(vFY3)'},$(vMonthNumber)>} SALES) ,
If(Sum({<[Fiscal Year]={'$(vFY4)'},$(vMonthNumber)>} SALES) )))))

 

How can I rewrite this in the load script without using variables & set analysis ?

 

Labels (4)
1 Reply
BrunPierre
Partner - Master
Partner - Master

Like this possibly?

FinalTable:
LOAD [Fiscal Year],
Month,
Sum(Sales) as Sales

Resident tmp

Where Month= '09'
and
(Year([Fiscal Year]) >= Year(Today()) and Year([Fiscal Year]) <= Addyears(Today(),5))

Group By [Fiscal Year], Month;

DROP Table tmp;