Forum Discussion
oslosa
6 years agoHelper I
Dynamic data retrieval based on today's date
Hi, I am trying to retrieve data for the most recent date from an SAP BW server. It requires me to query a parameter in the following format "[0FISCPER].[K4202003]" to retrieve March 2020 data. W...
- 6 years ago
oh, the solution I gave can easily be fixed... just add a 0 e.g.
yyyy0MM
ImkeF
6 years agoCommunity Champion
HI just to be specific here:
This is delivering the error-message you've posted below?:
{Cube.ApplyParameter, "[!V000003]", {{ Text.Combine({"[0FISCPER].[K4",
Text.From(Number.From(Date.Year(DateTime.LocalNow()))*100+Number.From(Date.Month(DateTime.LocalNow())))
,"]"})}}}
- ImkeF6 years agoCommunity Champion
Hm, actually a bit at a loss here - how can this formula actually work?
Wouldn't it have to be:
{Cube.ApplyParameter, "[!V000003]", {{ Text.Combine({"[0FISCPER].[K4" &
Text.From(Number.From(Date.Year(DateTime.LocalNow()))*100+Number.From(Date.Month(DateTime.LocalNow())))
& "]"})}}}Please check your exact coding again.
- oslosa6 years agoHelper I
Yes, that is what I tried to use.
- artemus6 years agoMicrosoft Employee
How about trying:
DateTimeZone.ToText(DateTimeZone.FixedUtcNow(), "yyyyMM", "en-us")Edit: lower case y