Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
sagar_vij99
Creator
Creator

Use of Variable in Set

Hi I am trying to showcase numbers in a text object using Set.

Here is my expression

=({$<P_Month={"$(=Date(Addmonths(Month_Name,-1),'MMMM'))"}>}$(TPH))

now TPH is a variable. Its definition : num((($(Pro_T)+$(Qct))/$(Avt))*100,'##.00')

Again explanation of each variable is :

Pro_t: num(sum(Processing_Time)/60,'##.00')

Qct: num(sum(QC_Time)/60,'##.00')

Avt: num((sum(Attendance))*7.5*.89,'##.00')


I need to calculate the result for last month for which set is there.

I cant make it work using different logics. please assist me here to get a solution.

Regards

Sagar

1 Solution

Accepted Solutions
sagar_vij99
Creator
Creator
Author

Hi Anil, I found a solution and thought of sharing. I used three different variables and used them to calculate numbers using set and then did different aggregations to get the output. I hope thats correct and if you think there is any issue with it, please let me know.

View solution in original post

13 Replies
avinashelite

What's the issue your facing ???

Anil_Babu_Samineni

What are you getting when you use this alone in text box? =$(TPH)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sagar_vij99
Creator
Creator
Author

it is showing error ')' missing

sagar_vij99
Creator
Creator
Author

it will give result but i want to calculate for previous month also. that is why i am using set.

Anil_Babu_Samineni

That is what i was over thinking the issue. Here, You need to set some thing like this

=Sum ({$<P_Month={"$(=Date(Addmonths(Month_Name,-1),'MMMM'))"}>}$(TPH))


So, Here i assume you have full month names

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sagar_vij99
Creator
Creator
Author

Hi Anil,

I tried the solution but i am getting error nested aggregation not allowed.

Anil_Babu_Samineni

True, Because Sum(...Sum(...Sum())) won't allow.

Can you attach application to check

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sagar_vij99
Creator
Creator
Author

please see the attached file. there is a text object on right with error

Anil_Babu_Samineni

I am thinking some thing like below Aggregations and Function Classes

Variable is

((num(Sum(Aggr(sum(Processing_Time),Month_Name))/60,'##.00') + num(Sum(Aggr(sum(QC_Time), Month_Name))/60,'##.00'))

/ num((Sum(Aggr(sum(Attendance), Month_Name)))*7.5*.89,'##.00'))*100

Expression

=Count({$<P_Month={"$(=Date(Addmonths(Month_Name,-1),'MMMM'))"}>} $(Variable))


POS - Change Month_Name to P_Month as needed


HTH

Anil

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful