Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm using the following code in my script to generate a fiscal year field.
LET vFM = 7;
[Fisc]:
DECLARE FIELD DEFINITION Tagged ('$date')
FIELDS
Dual(Right(YearStart($1,0,vFM),2)&'/'&(Right(YearStart($1,0,vFM),2)+1), YearStart($1,0,vFM)) AS [FiscalYear] Tagged ('$axis', '$year'),
Num(Dual('FY'&(Right(YearStart($1,0,vFM),2)+1), YearStart($1,0,vFM))) AS [FY_Num],
;
DERIVE FIELDS FROM FIELDS [TR_DATE] USING [Fisc] ;
I use the [FiscalYear] field for plotting and the [FY_NUM] to get max / current year or to sort the data.
However, If I use it to display in a table it works, but it's not working in set analysis nor does it return value if i use it in the KPI chart to test.
My Set Analysis code is following:
Count({$<[TR_DATE.Fisc.FY_Num]={"=$(=([TR_DATE.Fisc.FY_Num]))"}>} DISTINCT ID)
I get this message in the bottom which is telling me the FY_Num field is not returning the correct value in number format.
Can anyone identify the problem ?