Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

% by month

Hello:

Dimension: MonthYear and then FinancialClass

Measure: -Sum({<[TransPostedDateCalendar.MonthsAgo]={">=1<=4"}>}Payment_Total)

How do I calculate % by month? E.g. For June 2016, total payments was $27,888. The financial class *Unmapped* would be 79%, Blue Cross would be 9%, etc. I need each month to total 100%.


Thank you.

f49c999095074fafb0efbe69b2547065.jpg

1 Solution

Accepted Solutions
neelamsaroha157
Specialist II
Specialist II

Try

(Sum({<[TransPostedDateCalendar.MonthsAgo]={">=1<=4"}>}Payment_Total))

/

(Sum(Total <Month>{<[TransPostedDateCalendar.MonthsAgo]={">=1<=4"}>}Payment_Total))

View solution in original post

9 Replies
sinanozdemir
Specialist III
Specialist III

Hi,

Maybe try something like this:

Sum({<[TransPostedDateCalendar.MonthsAgo]={">=1<=4"}>}Payment_Total) / Aggr(Sum({<[TransPostedDateCalendar.MonthsAgo]={">=1<=4"}>}Payment_Total), MonthYear)


Hope it helps

neelamsaroha157
Specialist II
Specialist II

Try

(Sum({<[TransPostedDateCalendar.MonthsAgo]={">=1<=4"}>}Payment_Total))

/

(Sum(Total <Month>{<[TransPostedDateCalendar.MonthsAgo]={">=1<=4"}>}Payment_Total))

Not applicable
Author

Thanks Sinan. However, this didn't work. I need each of the FinancialClass to show a % and then all the FinancialClass within a month to total 100%.

136f27d8337b49b594e11ead6d7c7734.jpg

Not applicable
Author

Thanks Neelam. However, your suggestion didn't work. It gave me an error and didn't display anything.

neelamsaroha157
Specialist II
Specialist II

Can you share some sample data

neelamsaroha157
Specialist II
Specialist II

Check this out..Its works for me...

Capture3.PNG

Anonymous
Not applicable
Author

Try this:

Sum({<[TransPostedDateCalendar.MonthsAgo]={">=1 <=4"}>}Payment_Total)/

  Sum(TOTAL {<[TransPostedDateCalendar.MonthsAgo]={">=1 <=4"}>}Payment_Total)

To get 100% for each month add the Monthname to the expression;

Sum({<[TransPostedDateCalendar.MonthsAgo]={">=1 <=4"}>}Payment_Total)/

  Sum(TOTAL<MonthName>{<[TransPostedDateCalendar.MonthsAgo]={">=1 <=4"}>}Payment_Total)

PS: Number format is set to simple --> 12%

See attached example:

Capture.PNG

sunny_talwar

Do you have two dimension and 1 expression or do you have one dimension and 7 expressions in your chart?

If you have 2 dimensions and 1 expression, then something like this should work

Sum(Measure)/Sum(TOTAL <Dimension1> Measure)

If you have 1 dimension and 7 expressions, then something like this should work

Expression1/RangeSum(Expression1, Expression2, Expression3, Expression4, Expression5, Expression6, Expression7)

Not applicable
Author

It worked neelam! Thank you so much!

1d0f8c25260945149d26eeb6c21834a9.jpg