0
LOAD
   if(Year(max(FISCAL_YEAR))=Year(Today()),
   Year(max(FINANCIAL_YEAR))) as Curr_FY,

   if(Year(max(FISCAL_YEAR))=Year(Today()),
   Year(today()-1)) as Prev_FY
   Resident [data_table];

   Let Current_FY = '=Curr_FY';
   Let Last_FY = '=Prev_FY';

I want to create Dynamic variable for current FISCAL_YEAR and last FISCAL_YEAR

aarav
  • 5
  • 2

1 Answers1

0

If the table contains only a single value for Curr_FY and Prev_FY then you can use peek script function to get the value in a variable

Let Current_FY = peek('Curr_FY');
Let Last_FY = peek('Prev_FY');

Bear in mind that if there are multiple values then peek will return the last loaded value

Stefan Stoichev
  • 4,615
  • 3
  • 31
  • 51