Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
anat
Master
Master

total sales by selected sales

i have data like:

Country,State,sal

Ind,AP,100

Ind,DL,200

AUS,ST1,50

AUS,ST2,300

 

need to display :total sales/filtered value 

if no selection: total sales :650

If I make any selection 650/selected sales

if I select AP:650/100

if I select Ind:650/300

i am trying like sum(<Country=,State>sal)/sum(sal),this is working if made any selections,if no selection i am getting 1.

7 Replies
sergio0592
Specialist III
Specialist III

Hi,

It should works with  sum({1} sal)  --->650   and sum(sal)  ---> selected sales

anat
Master
Master
Author

If no selection made, value coming 650/650

anat
Master
Master
Author

any solution pls

sergio0592
Specialist III
Specialist III

'If no selection made, value coming 650/650'

Yes, ans what is for you the expected output when no selection made?

anat
Master
Master
Author

if no selection made value should be 650/1=650

sergio0592
Specialist III
Specialist III

Ok, try :

 

=if(GetSelectedCount(State)=0 and GetSelectedCount(Country)=0, sum({1} sal) / 1, sum({1} sal) / sum(sal))

 

anat
Master
Master
Author

Thanks for prompt reply, I am also trying same. Looking for alternative solution