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

already sum in expression

i have a filed "Amount" in that i already done this in script

load

id, 

sum (amount)

from abc

group by id 

 

now i am trying to add expression like this 

({<id={'1'}>} amount)

but this does not work any help 

here in expression i dont want to add sum because this  sum is already in script 

10 Replies
Gysbert_Wassenaar

You should just use sum so you and others understand what kind of measure you created. But if you really don't want to use sum, then use avg or min or max or the only() function. Only({<id={'1'}>} amount).

A chart expression is always aggregated. Even if you don't specify an aggregation function. In that case the only() function is applied implicitly. If you want to use set analysis then you must explicitly use an aggregation function.


talk is cheap, supply exceeds demand
capriconuser
Creator
Creator
Author

i used only expression but figures is going to display like this ' - ' 

 

i dont want to use sum because i already use in script 

Gysbert_Wassenaar

post a small qlikview document that illustrates the problem

talk is cheap, supply exceeds demand
capriconuser
Creator
Creator
Author

check attached file

capriconuser
Creator
Creator
Author

any help

kishorj1982
Creator II
Creator II

This should work,

 

load

id, 

sum (amount) as amount

from abc

group by id 

capriconuser
Creator
Creator
Author

i think you did not read my question properly

capriconuser
Creator
Creator
Author

@Gysbert_Wassenaar any solution
Gysbert_Wassenaar

You did not calculate the sums in the script per code_name, but per combination of code_name AND name AND Update_Date. That means there is no single figures value for a single code_name value. And that means you MUST use the sum function in your chart expression if you want to sum all the different figure values that exist for a single code_name value.

Or select a single date. If you do that you will see that your expression with Only() does return a result.


talk is cheap, supply exceeds demand