cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to Filter Current vs. Previous Year Data Using a Single Posting Date Input Control in SAP Analyt

0 Likes
981

Hi everyone!!

I’m working on a requirement in SAP Analytics Cloud where I need to use a single Posting Date input control to filter two different tables in a story. The first table should display data for the exact month selected by the user through that input control, while the second table should automatically show data for the same month in the previous year. Both tables use the same dimensions—G/L Account and Posting Date—and the measure Amount in Company Code. For example, if the user selects January 2025, the first table should show January 2025 data, while the second should show January 2024 data.

The challenge is that SAC applies the input control directly to the Posting Date dimension for both tables, and I need a way to “offset” the Posting Date filter by one year only for the second table. I’m looking for the best approach to achieve this,  any SAC feature that allows filtering one table based on a previous-year version of the selected date. If anyone has implemented something similar or knows an efficient workaround, I would really appreciate your guidance.

Accepted Solutions (1)

Accepted Solutions (1)

jmoon
Explorer

If you want it with a input control, it will have to be a story filter.  Select your 1st table and then filter on your date but use the Filter by Range option:

jmoon_0-1765381135311.png

When the range option comes up. select Date Type and use Create Custom Date:

jmoon_1-1765381225249.png

Name your data selector and change the Granularity to Month and when you want to start the selection box:

jmoon_4-1765381437921.png

In the Range, make sure the Granularity is Month for your selection:

jmoon_5-1765381480153.png

This will place a story filter on your story and the 1st table will be filtered based on that selection:

jmoon_6-1765381535244.png

Now edit your 2nd table, click on the Date dimension and again selected,  Filter by Range:

In the Date Type make sure to select your new Custom "Select Date" member, then in the Range area

Change the Range Type to Offset and set the Granularity to Month with zero look back or look ahead, then in the Look Back Direction, select Offset Granularity to Year and put 1 in Offset Amount, it should already show you its is selecting the prior year same month:

jmoon_7-1765381754564.png

You can then click on the select date filter and choose your needed monthly period

jmoon_8-1765381815668.png

When the tables update, they will be current month selected and same month prior year.

jmoon_9-1765381850068.png

 

 

 

 

 

0 Likes
Thankyou so much

Answers (2)

Answers (2)

spurwar
Product and Topic Expert
Product and Topic Expert
N1kh1l
Active Contributor
0 Likes

@AhmadAzaanFarooqui 

One option is that you can create restricted measure based on dynamic time offset to previous year for the second table. The other option is that you can use scripting to read the Input control selection , offset it by a year and then pass it as a dimension filter to the second table.

 

Nikhil