Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how to divide the total number against a number

Hello All,

Is me again, you guys need to bear with me as i dont know if to start anthoer post or continue with the old.

here is my expression:

=SUM({<Status={'Auth'}>}1)+ sum(Amount) /

(avg({$<ArrivedCount ={1}>}Amount) * count({$<Status={'A CAMB','A BIRM','A HURN','A CUMB','A BRIG','A IREL'}>}Status))

basically, i am trying to divide between this two expression, the first is a total of authorised bikes and the second is  a total

now i want to divide auth by total as seen above but am not geting it right, any idea would help

1 Solution

Accepted Solutions
tresesco
MVP
MVP

May be parenthesis issue. Try:

= (SUM({<Status={'Auth'}>}1)+ sum(Amount)) /

(avg({$<ArrivedCount ={1}>}Amount) * count({$<Status={'A CAMB','A BIRM','A HURN','A CUMB','A BRIG','A IREL'}>}Status))

View solution in original post

8 Replies
simondachstr
Luminary Alumni
Luminary Alumni

Not sure what exact number you're trying to calculate but here is a suggestion:

count({<Status={'Auth'}>} Status)+ sum(Amount) /

(sum({$<ArrivedCount ={1}>}Amount)/sum({total $<ArrivedCount ={1}>}Amount)) * count({$<Status={'A CAMB','A BIRM','A HURN','A CUMB','A BRIG','A IREL'}>}Status))

Not applicable
Author

Hello Martin,

I have a table which

1. count no of auth

2. which count no of auth then sum the amount which is (count({<Status={'Auth'}>} Status)+ sum(Amoun) as Authorise Total

3. count no of arrive bikes that are repairable by location ( count({$<Status={'A CAMB','A BIRM','A HURN','A CUMB','A BRIG','A IREL'}>}Status)) as RepairsTotal

my fouth task is to divide total by repairs (total/repairs) which i am taking no 2 / no 3 to get no 4.

tresesco
MVP
MVP

May be parenthesis issue. Try:

= (SUM({<Status={'Auth'}>}1)+ sum(Amount)) /

(avg({$<ArrivedCount ={1}>}Amount) * count({$<Status={'A CAMB','A BIRM','A HURN','A CUMB','A BRIG','A IREL'}>}Status))

Not applicable
Author

Hi,

Is there a way i can get the total number of each rows, just to add Total at the end of sep-13  or a seperate table that will give me the total count as seen in below screen shot ( to get the figures i did sum(source). If i sum the first row i will get 77 and same to other rowsCapture.JPG.jpg

tresesco
MVP
MVP


Goto presentation tab, select your dimension and then check 'Show Partial Sums'

Not applicable
Author

Hi Tresesco,

Thanks , i am getting there but i need to get the total to the extreme end, i have tried draging it but no avail, any ideaCapture.JPG.jpg

Not applicable
Author

Thanks It is done, funny enough try and error sort it out, i click on another dimension then check subtotals at bottom and it works, i dont know the logic behind it but would love more clarity why it happens.Capture.JPG.jpg

Last but not the least for the day..

I want to do something like partitions where only the year 2013 will appear just like below screen shot, i know i can do this in SQL but is there a way to go about itCapture.JPG.jpg like using expression to make 2013 static

Not applicable
Author

Thanks all, i have sorted it out using =if([Arrived Year]>2012,[Arrived Year]),

try and error works fine.. happy days, thanks to all that has assited me today