Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Total for variable

Hi

I have expression in table called 'vPass' that return result 0 or 1.

The vPass value is varible called 'vCalTrueFalse':

vPass =$(vCalTrueFalse).

I need to create total field for vPass in TextObject at dashboard.

I tried ' Sum($(=vCalTrueFalse))' but it give me an error: 'Nested aggregation not allowed'.

How can I do it?

Thanks!

Labels (1)
26 Replies
uacg0009
Partner - Specialist
Partner - Specialist

I think I didn't use any aggregation function in text, only sum and count.

You can test it separately, first crated a text object to calculate the =sum($(vsPass))

then use another text to calculate the =Count($(vsPass))

then try to make it together or find out what's the problem

Anonymous
Not applicable
Author

In both cases I get this error.

uacg0009
Partner - Specialist
Partner - Specialist

because the logic of your vtpass is a little complex, and I don't have the data like you. So I simplify the vtpass.

Is your vtpass showing fine? fail and pass.

because I think if the vtpass is ok, the vspass is just to calculate the vtpass :

set vsPass = if($(vtPass) = 'Fail',0,if($(vtPass) = 'Pass',1));


I just need to use your vtpass definition and use my vspass definition.


And you also can try to use =$(vtPass) and =$(vsPass) into the chart to see whether it's ok or not, just like me below:

vPass and the last column.


Total for variable2.PNG

Anonymous
Not applicable
Author

The results in both column is OK. I use '=$(vsPass)' or only '$(vsPass)'.

Pass and vPass column show the correct data.

Only text object calculation is wrong.

I all the time get the same error about 'Nested Aggregation not allowed"

uacg0009
Partner - Specialist
Partner - Specialist

maybe trying this :

=sum(aggr($(vsPass),DashboardName,ReportParam))/Count(aggr($(vsPass),DashboardName,ReportParam))

change the DashboardName,ReportParam to your dimensions.

Anonymous
Not applicable
Author

Thank you its work! but not as I want ....

It show incorrect result. I just want it take what I show in table.

The combination of Dashboard and ReportParam is not correct, I need only the present rows in the table.

uacg0009
Partner - Specialist
Partner - Specialist

I think you need to add all dimensions of your table into the AGGR function, not just these 2 dimensions, because I only have 2 dimensions, so I only add these 2 into AGGR, maybe you need more.