cancel
Showing results for 
Search instead for 
Did you mean: 

Sap Analytics Cloud - Input a Date Parameter into a Data Action to assign a value to a measure

CandiceFritz
Discoverer
0 Kudos

Hi SAP community,  

I want a data action to be trigged when I assign hours to an employee. 

In this case I want to assign hours worked by an employee to a measure "AssignHours" on a date chosen by the user. 

This is the data action code: 

CandiceFritz_0-1714939652195.png

The Data is in the format YYYY-MM-DD and the parameter input is a string. 

When I replace MEMBERSET [d/Date] = %Date% with MEMBERSET [d/Date] = "2024-01-01" (meaning hard code the date), it works and assigned the hours to the measure. 

However, as I am calling the data action in a responsive story page, when I hard code this into the pulled parameter shown below it does not assign the hours to the measure. 

CandiceFritz_1-1714940268733.png

Even though the parameters are accepted by the Data Action (no issues detected in Data Action Monitor), the data action fails to trigger and gives the following error:
There are validation errors in the data action when trying to run it on version "Actual" 

Can you assist with issue I am having. 

 

 

Galin_Manolov
Participant
0 Kudos

Hi, what are the parameters for the data action in the data action parameter when you pass the parameters in the data action trigger vs passing in code?

Galin_Manolov_0-1715022475696.png

 

View Entire Topic
CandiceFritz
Discoverer
0 Kudos

Hi @Galin_Manolov, I have added the parameters below: 

 

Screenshot 2024-05-07 065801.png

Galin_Manolov
Participant

Hi, you said that the data action works when you hardcode the Date parameter like this MEMBERSET [d/Date] = "2024-01-01". What's the Date parameter in the data action monitor when hardcoded?

It looks like a time hierarchy problem. Maybe the date format that the data action is expecting is not correct. 

Try creating a table with date dimension and see what's the date format like shown in this video starting at min 08:00
https://youtu.be/Sy2on6IFP6A?si=uvIUvPW-B4NQ_9l0&t=435

CandiceFritz
Discoverer
0 Kudos
HI Galin, thank for linking the Youtube tutorial on Adding Dynamic Date Controls. I am solved my issue and in addition learnt a bit more about how to debug in SAC using the MS developer tool!