Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
xavieravinson
Contributor III
Contributor III

using aggr function inside variable

Hi All,

        Shall i use the Aggr function inside the Variable.I have already tried the function inside the variable. It is working on selections. with out selection it is giving overall sum of the measure.

My Variable

      =Sum(Aggr(Budget,[Sales Off],Employee))

Sample Data Inline

LOAD * INLINE [

    Budget, Employee, Sales Off, Sales Grp

    10000, Xavier, 1001, 101

    15000, Antony, 1001, 102

    10000, Napolean, 1002, 103

    20000, Ravinson, 1002, 104

];

with Regards

XavieRavinson

18 Replies
xavieravinson
Contributor III
Contributor III
Author

Hi Anil,

         Thanks for the reply.

Actual data is bit different from the sample. and the data volume also very high. My question is not getting the result. Shall i use the aggr() function inside the variable with out any selection is my actual question.

With Regards,

XavieRavinson.

Anil_Babu_Samineni

I am not sure, May be that's my fault to understand. Have you seen Manish Reply he share few links which was nice. Check those and then try to share Real data for Understanding then we may offer you even we will use the Aggr with Vaitbles.

xavier Ravinson wrote:


Shall i use the aggr() function inside the variable with out any selection is my actual question.

Can you confirm this how you created variable for aggregation and then please share which expression you used to get 100% Accuracy data?

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
parimikittu
Creator II
Creator II

Hi Xavier, This expression( =Sum(Aggr(Budget,[Sales Off],Employee)) ) don't make sense as it is not aggregating nums, it should be Aggr(sum(Budget),[Sales Off],Employee). Here we are aggregating nums on Sales Off and Employee

xavieravinson
Contributor III
Contributor III
Author

Hi Anil,

My Expression Used in the Sample is:

=Sum(Aggr(Budget,[Sales Off],Employee,[Sales Grp]))

and my question is shall i use the same expression inside a variable.

With Regards,

XavieRavinson.

Anil_Babu_Samineni

If you want to use, This as a variable then you will get like FAV(Full Accumulation Value) for each Employee like 55000 (For Ex.)

And this is not make sense to store the FAV as i mentioned before. So, further processing you may not get as achieved with the same variable which done the Expression for Variable. For below, you can use vVariable or $(vVariable). As i mentioned above, you will get 55000 for sample data for each employee.

LET vVariable = =Sum(Aggr(Budget,[Sales Off],Employee,[Sales Grp]))


HTH

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
xavieravinson
Contributor III
Contributor III
Author

Hi Vj

       Sum(Aggr(Field_to_Calculate,dimension1,dimension2,dimension3....,n))

saimahasan
Partner - Creator III
Partner - Creator III

If this is the expectation, then you can simply create a pivot chart with dimension Sales Grp and Employee and use sum(Budget) as expression and its done.

xavieravinson
Contributor III
Contributor III
Author

Thanks for your reply.

My actual data is different and data volume is very high. Sorry for this sample data that does't have much things. But my question is shall i use the same aggr function inside the variable.

It is not about the result.

Thank you,

XavieRavinson

parimikittu
Creator II
Creator II

if sum is used out side Aggr function, then it will give the total value of the table instead of total per dimnesions.