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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
JASalinas
Creator
Creator

Totals Function Count in KPI

Hi friend, I have the next set analysis in the table chart:

if(((Sum({<[ACCNT_CODE]={"611110"}, [FNCT]={"DT*"}, [ORGID]={"T*"}, [PROJ]={"Y2022"}, [LEDGER]={"A"}>}[AMOUNT]) /
(Sum({<[ACCNT_CODE]={"611110"}, [FNCT]={"DT*"}, [ORGID]={"T*"}, [PROJ]={"Y2021"}, [LEDGER]={"A"}>}[AMOUNT]))) -'100%') >= '8.38%',
((Sum({<[ACCNT_CODE]={"611110"}, [FNCT]={"DT*"}, [ORGID]={"T*"}, [PROJ]={"Y2022"}, [LEDGER]={"A"}>}[AMOUNT]) /
(Sum({<[ACCNT_CODE]={"611110"}, [FNCT]={"DT*"}, [ORGID]={"T*"}, [PROJ]={"Y2021"}, [LEDGER]={"A"}>}[AMOUNT]))) -'100%'))

JASalinas_0-1674007569231.png

if Total function is Auto tha value is 0.17 but if Total Function is Count the value is 867, I want the value 867 in a KPI,  the same set analysis in the KPI the value is 0.17

JASalinas_1-1674007852394.png

Help me please!...

Thak you in advanced for your help...

Labels (1)
3 Replies
Digvijay_Singh

May be try like this - 

Sum(Aggr(<Your expression>,description)), 'description' as I see is your chart dimension

JASalinas
Creator
Creator
Author

Thank you fot you answer, yes I did that

=sum(aggr(if(((Sum({<[ACCNT_CODE]={"611110"}, [FNCT]={"DT*"}, [ORGID]={"T*"}, [PROJ]={"Y2022"}, [LEDGER]={"A"}>}[AMOUNT]) /
(Sum({<[ACCNT_CODE]={"611110"}, [FNCT]={"DT*"}, [ORGID]={"T*"}, [PROJ]={"Y2021"}, [LEDGER]={"A"}>}[AMOUNT]))) -'100%') >= '8.38%',
((Sum({<[ACCNT_CODE]={"611110"}, [FNCT]={"DT*"}, [ORGID]={"T*"}, [PROJ]={"Y2022"}, [LEDGER]={"A"}>}[AMOUNT]) /
(Sum({<[ACCNT_CODE]={"611110"}, [FNCT]={"DT*"}, [ORGID]={"T*"}, [PROJ]={"Y2021"}, [LEDGER]={"A"}>}[AMOUNT]))) -'100%')), ORGID))

But I get the next value

JASalinas_0-1674013235733.png

And must be 867...

Digvijay_Singh

If possible, can you export the data and see if 867 is a sum of all numbers or a count of all numbers. Its a little hard to understand if its just a count of all numbers because I see SUM in the actual expression being used.

Also whats ORGID? I see you have description in the chart, I am not sure if using actual chart dimension can make any difference.

If possible, please share a data sample or sample app to look further to provide needed solution.

Thanks,