Dynamic Reports - Calculating Report ID

More
1 year 9 months ago #24434 by prashant
Hi, 
I am trying to use the new dynamic report , specifically using a calculation to find the Report Object ID. This is my script which keeps failing. I am using python

I have an object <lettertype> which kickstarts the package, I can confirm by using ShowMessage , the <letterytype> variable has the right string
Code:
lettertype_mapping = { "Appointment": 7392, "Confirmation": 7439, "Experience": 7437, "Internship": 7430, "Offer": 7367 } Result.value = lettertype_mapping[<lettertype>]

Also the new calculation window is missing the Run option , there is no way to 'test' if the calculation is right/wrong without running the package , can't we use transformation style value passing to verify ? 

Please Log in or Create an account to join the conversation.

More
1 year 9 months ago #24435 by prashant

Also the new calculation window is missing the Run option , there is no way to 'test' if the calculation is right/wrong without running the package , can't we use transformation style value passing to verify ? 

See the same script running fine in calculations in a transformation 

 

Please Log in or Create an account to join the conversation.

More
1 year 9 months ago #24439 by admin
Variables are not replaced inside scripts for Dynamic Actions parameters.
What you need to do is to use etltools package to get variable value

etltools.GetVariable('<VariableName>') 

Mike
ETL Architect

Please Log in or Create an account to join the conversation.

More
1 year 9 months ago #24450 by prashant
Below worked !

Question
1. This calculation window , why are we not allowed to run the script from within the window, like we can do in packages or transformation ? 
2. Since we are not utilising getvariable , is this now equivalent to "Script" Action or some combination of calculation + package script



import etltools
lettertype = etltools.GetVariable('<lettertype>')
# Define the mapping of letter types to their corresponding values as strings
lettertype_mapping = {     "Appointment": "7392",     "Confirmation": "7439",     "Experience": "7437",     "Internship": "7430",     "Offer": "7367" }
# Assign the corresponding string value to
Result.value Result.value = lettertype_mapping[lettertype]
The following user(s) said Thank You: Peter.Jonson

Please Log in or Create an account to join the conversation.

More
1 year 9 months ago #24451 by Peter.Jonson
This calculation window , why are we not allowed to run the script from within the window, like we can do in packages or transformation ? 

This is yet to be implemented.   

Peter Jonson
ETL Developer

Please Log in or Create an account to join the conversation.

More
1 year 9 months ago #24452 by prashant

This calculation window , why are we not allowed to run the script from within the window, like we can do in packages or transformation ? 

This is yet to be implemented.   
haha cool

Please Log in or Create an account to join the conversation.

Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Read more
Marketing
Set of techniques which have for object the commercial strategy and in particular the market study.
Google
Accept
Decline
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline
Google Analytics
Accept
Decline
Functional
Tools used to give you more features when navigating on the website, this can include social sharing.
Advertisement
If you accept, the ads on the page will be adapted to your preferences.
Google Ad
Accept
Decline
Save