Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
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 II
Partner - Master II

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;