Import values from previous period into current period

LucaRicci
edited September 2023 in Modeling

Hi,

I am trying to build an import which should take the values from a month to the next one, in order to create a baseline the user would then modify as he pleases. Once he's done so, he should then import the new values into the next months.

The import seems to work, however, it deletes the value from the previous month. So for instance, it takes the value from jan 22 to feb 22, but then it deletes the value from jan 22.

How can I fix this?

Here's how I have built the import:

and here is the module (this one time I did not use a view for the import):

Thanks in advance,

Luca

Answers

  • @LucaRicci Is your import data source a saved view?

    If it is not I suggest you create a Saved View with a filter applied to the saved view which restricts the time period to only show the month you want updated. Using your example, the saved view should only have "Feb 22" period showing. If you are already using this type of view, check the mapping against time that you are only updating "Matched Items only" and not "All items"

    Hope this helps

  • LucaRicci
    edited September 2023

    Hi @TristanS , thanks for your answer.

    I followed your advice and it works, however that way only allows me to take the value from january to february, how can make it work the same way for any following month? Shall I make a customed view for each month?

    What's more, the user should be able to enter the value starting from any month. I believe that following the way you suggested the user would be forced to start entering the data from january. What we want instead is to let the user modify the current values at any month and then import those values into the next months.

    I hope that is clear

  • Hey @LucaRicci

    In your saved view, don't make "Feb 22" hard coded, instead use a filter.

    Filter line item formula can be Previous Percentage line item <> 0

    Cheers!!

  • @LucaRicci another option is to look at other more generic conditions as a filter. For example, if you are running this action at the end of every month with the intention of updating the "next" month. E.g.

    • Run action 31 Jan 22 to update Feb 22 parameters
    • Run action 28 Feb 22 to update Mar 22 parameters
    • Run action 31 Mar 22 to update Apr 22 parameters

    You can create a time filter module with the following line items

    Line Item Name

    Format

    Formula

    Item

    Time Period (Month)

    Item(TIME)

    First Day of Month

    Date

    START()

    Is Current Month?

    Boolean

    CURRENTPERIODSTART() = START()

    First Day of Next Month

    Date

    If 'Is Current Month?' then NEXT(First Day of Month) else blank

    Is Next Month?

    Boolean

    First Day of Next Month = First Day of Month

    Apply a filter to your saved view where "Is Next Month?" is True

    This is just an example that may fit your requirements. Otherwise, you can apply a other generic filters such as what Himanshu suggested. It really depends on your use case