Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All!
How can I enter the years in the Yearlist table into the vLoadedPartitionList variable?
LET vStartingYear = Year(Today()) - 4;
LET vTargetYear = Year(Today());
[YearList]:
LOAD
$(vStartingYear) + RowNo() - 1 AS Year
AUTOGENERATE
$(vTargetYear) - $(vStartingYear) + 1;
LET vLoadedPartitionList = ???; // Partition List. If it is not null, then only this partition(s) will be loaded. (for yearly partition(s): YYYY (eg: '2019, 2020')
Thanks for all the help!
Hi @bajor14 ,
Not sure to understand your question, but if you want to store the years which is in your table YearList into your variable vLoadedPartitionList, you can do this :
LET vStartingYear = Year(Today()) - 4;
LET vTargetYear = Year(Today());
[YearList]:
LOAD
$(vStartingYear) + RowNo() - 1 AS Year
AUTOGENERATE
$(vTargetYear) - $(vStartingYear) + 1;
LET vCountYear = FieldValueCount('Year');
Trace Number of years : $(vCountYear);
SET vYear_init = 1;
For i=1 to $(vCountYear)
If '$(vYear_init)' = 1 then
LET vYear_init = FieldValue('Year',$(i));
Else
LET vYear_init = '$(vYear_init)' & ',' & FieldValue('Year',$(i));
End If
Next
LET vLoadedPartitionList = chr(39) & '$(vYear_init)' & chr(39);
Trace vLoadedPartitionList = $(vLoadedPartitionList);
Hope this helps.
Regards,
Agathe.
Hi @bajor14 ,
Not sure to understand your question, but if you want to store the years which is in your table YearList into your variable vLoadedPartitionList, you can do this :
LET vStartingYear = Year(Today()) - 4;
LET vTargetYear = Year(Today());
[YearList]:
LOAD
$(vStartingYear) + RowNo() - 1 AS Year
AUTOGENERATE
$(vTargetYear) - $(vStartingYear) + 1;
LET vCountYear = FieldValueCount('Year');
Trace Number of years : $(vCountYear);
SET vYear_init = 1;
For i=1 to $(vCountYear)
If '$(vYear_init)' = 1 then
LET vYear_init = FieldValue('Year',$(i));
Else
LET vYear_init = '$(vYear_init)' & ',' & FieldValue('Year',$(i));
End If
Next
LET vLoadedPartitionList = chr(39) & '$(vYear_init)' & chr(39);
Trace vLoadedPartitionList = $(vLoadedPartitionList);
Hope this helps.
Regards,
Agathe.
Hi @Agathe!
Perfect! That's exactly how I wanted it! Thank you very much!!!!!