Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Luke_Killer_IT
Creator
Creator

how to make a sum

Hi,

I have a problem with counting totals in a new table. I don't know how to make the new table show the same total as the old table but the problem is that in the new table I have to group by calendar and in the old table I have to group by article 

Old table:

Script:if((sum({<Merkmal={"23"}>}Auspr)>=8500 )/16000,'1',sum({<Merkmal={"23"}>}Auspr)/16000)

Luke_Killer_IT_0-1633692484189.png

new table:

Script:sum({<Merkmal={"23"}>}Auspr)/16000

Luke_Killer_IT_1-1633692513994.png

 

1 Solution

Accepted Solutions
marcus_sommer

Both expressions aren't identically and therefore it's rather unlikely that they would return the same results. Beside this the expression isn't a simple aggregation else it contains conditions which are related to the dimensionally context in which they are performed.

This means you need to unify both expressions in regard to the mentioned context. If we assume that your first expression/object is correct you need for the second object an expression like this one:

sum(aggr(Expression, Teile, KW))

- Marcus

View solution in original post

8 Replies
MayilVahanan

Hi

May be, try like below

Sum({<Merkmal={"23"}>}Aggr(sum({<Merkmal={"23"}>}Auspr)/16000, Teile, KW))

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Mario_ES
Contributor III
Contributor III

It may be that there are some Null values in one of the fields of selection.

Luke_Killer_IT
Creator
Creator
Author

hi Mayil  

its not working 😞 

MayilVahanan

Hi 

can you share sample app??

 

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Luke_Killer_IT
Creator
Creator
Author

 

Unfortunately, that can be a problem 

Luke_Killer_IT
Creator
Creator
Author

Maybe the problem is with the 1 in this upper scrypice, notice that if it exceeds the given amount it has to write one

marcus_sommer

Both expressions aren't identically and therefore it's rather unlikely that they would return the same results. Beside this the expression isn't a simple aggregation else it contains conditions which are related to the dimensionally context in which they are performed.

This means you need to unify both expressions in regard to the mentioned context. If we assume that your first expression/object is correct you need for the second object an expression like this one:

sum(aggr(Expression, Teile, KW))

- Marcus

Luke_Killer_IT
Creator
Creator
Author

Thank you