logo

Warning: The forum is now for consultation only. Please use GitHub Discussions to post any questions or comments.


Welcome Guest ! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
ctrazzi  
#1 Posted : Monday, August 7, 2023 11:49:20 AM(UTC)
ctrazzi

Rank: Member

Groups: Registered
Joined: 7/14/2023(UTC)
Posts: 25
Man
Italy
Location: Torino

Thanks: 8 times
Hello,
in my report I nedd to calculate the (price*hour)+hardware_cost, and other datas that involve the "price" value
Hour | hardware_cost
---------------------
1.00 | 0
1.00 | 200
1.50 | 10.6
1.75 | 15
0.25 | 35

"price" is a constant value of 25, I wish to put that value in a variable in order to avoid repeating it n times inside my model code.

In other model I have the same "price" value to use so, if is possible, I would like to define a global variable in the report to use inside them. In this way if I have to change the "price" value, I have not to change it in all my model, but only one time for all the report.

I have try to use collection, but it does not work. For what I understand, the collection are used only to filter data, is that right?

Can you please provide an example about this?

Edited by user Tuesday, August 8, 2023 10:08:42 AM(UTC)  | Reason: Not specified

epf  
#2 Posted : Tuesday, August 8, 2023 10:05:07 AM(UTC)
epf

Rank: Administration

Groups: Administrators
Joined: 12/20/2013(UTC)
Posts: 1,209
Switzerland

Thanks: 14 times
Was thanked: 206 time(s) in 199 post(s)
You may try this:
Create a task
Loop for each model in your report.
Select the element involved by the calculation
Assign the SQL property with your formula having 25.

Note that you may use also global scripts defined with the Server Manager to share scripts or functions amongst reports.

Edited by user Tuesday, August 8, 2023 10:07:07 AM(UTC)  | Reason: Not specified

ctrazzi  
#3 Posted : Tuesday, August 8, 2023 10:06:51 AM(UTC)
ctrazzi

Rank: Member

Groups: Registered
Joined: 7/14/2023(UTC)
Posts: 25
Man
Italy
Location: Torino

Thanks: 8 times
I am sorry but I have not understand...can you provide a simple example please?
ctrazzi  
#4 Posted : Friday, October 6, 2023 8:48:22 AM(UTC)
ctrazzi

Rank: Member

Groups: Registered
Joined: 7/14/2023(UTC)
Posts: 25
Man
Italy
Location: Torino

Thanks: 8 times
Hi any news about my topic?
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.