Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
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

13 Replies
Anil_Babu_Samineni

Try this as full expression

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

((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)

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
Anil_Babu_Samineni

Or May be stalwar1hic‌ helps you

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 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.

Anil_Babu_Samineni

Glad you found the answer only thing you should share behind the correct answer so then next land up can tackle easily...

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