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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Vince_CH
Creator III
Creator III

Qlik sense: count expression results is not same with list box same counts

Hi All, i make a KPI with counting the purchase times at 4.87K, i also make a list box besides and counts the quantity to be 4370 instead. it seems to be a gap about 500, what could be the cause?

11.jpg

27 Replies
Vince_CH
Creator III
Creator III
Author

thanks, but when i put same like this as below, it indicated invalid expression, what is wrong?

11.jpg

Vince_CH
Creator III
Creator III
Author


@sunny_talwar wrote:

Not sure, but may you you mean this

Sum(Aggr(
PUR_PRICE
, PUR_Price, FiscalYear_order, PUR_Currency, PUR_Currency_1, PUR_Order_Date))

Hi Stalwar, sorry again to bother, if  want to sum up the purchase value by PUR_Price*PUR_Currency_1, 

I tried this way: Sum(Aggr(PUR_Price*PUR_Currency_1, PUR_Price,....)),but it doesn't work out.  i also tried like: Sum(Aggr(PUR_Price, PUR_Price,....)*PUR_Currency_1), it doens't work out too.

how shall i write in the expression?

sunny_talwar

Add it as a measure and not dimension 🙂
sunny_talwar

Can you share the exact expression you tried?
Vince_CH
Creator III
Creator III
Author

Hi Stalwar,  actually my expression tried with the sample file are as following:

Sum(Aggr(PUR_Price*PUR_Currency_1,PUR_Price,FiscalYear_order,PUR_Currency,PUR_Currency_1,PUR_Order_Date))

or

Sum(Aggr(PUR_Price,PUR_Price,FiscalYear_order,PUR_Currency,PUR_Currency_1,PUR_Order_Date)*PUR_Currency_1)

but the results are not identical to the sum  results as calculated of (PUR_Price*PUR_Currency) by excel as i manually verified.

 

 

However, in my original source file, it includes more fields like below besides the existing fields in sample source file, which contains the PUR_Order_Number, PUR_Order_Item, PUR_Material_Number, this three field decide the DISTINCT row, so i try to use expression as:

Sum(aggr(PUR_Price*PUR_Currency_1, PUR_Order_Number, PUR_Order_Item, PUR_Material_Number)

or 

Sum(aggr(PUR_Price, PUR_Price, PUR_Order_Number, PUR_Order_Item, PUR_Material_Number)*PUR_Currency_1)

but on above, the calculated results are all zero.  i don't know why? any idea?

11.jpg

sunny_talwar

Did you bring those fields into your dashboard... lol... you might have... but that is the obvious thing I wanted to ask before we look into other issues.
Vince_CH
Creator III
Creator III
Author

yes, i am trying to set up various KPI with these fields involved in the expression. it works with simple counts, sum, but in terms of the purchase value like above, it seems challenging, or do you have other alternative advice toward this?
Vince_CH
Creator III
Creator III
Author

Hi Stalwar, didn't understand your meaning, please help to get your points correctly. you did great on earlier above expressions, so it is the last step for expression of purchase value (PUR_Price*PUR_Currency_1), how to write it correctly ? thanks a lot