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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
thanhphongle
Creator II
Creator II

sum monthly payments from a date interval in a pie chart

Hello Community,

this is an example of my database

Rent IDRent beginRent endPayments
101.01.1231.12.20171000
101.01.1231.12.20171000
201.01.1331.12.2019100
201.01.1431.12.2019100
301.01.1531.12.2019100
401.01.1531.12.202510
501.01.1631.12.202510

I want to sum up all payments ending before vFixdate and sum up all payments ending if Rent end >vFixdate AND < 01.01.2020 and sum up all payments which ends if Rent end is after 01.01.2020.

Qlikview should return me in a pie chart 3 different pieces.

First piece = sum(Payments) before vFixdate = 144000

Second piece = sum(Payments)  Rent end > vFixdate and Rend end < 01.01.2020 = 10800

Third piece = sum(Payments) Rent end > 01.01.2020 = 1440

My solution was

I create a variable called vFixdate = 01.01.2019

I picked Rent end as Dimension

My expression is:

if([Rent end]< vFixdate, sum(Payment), if([Rent end] > vFixdate AND [Rent end] < date('01.01.2020'), sum(Payment), if([Rent end]<>date('01.01.2020'), sum(Payment))))

But somehow QV returns me in a pie chart so many little pieces while i just wanna have 3 pieces which sum up all total values.

Could anyone help me out here?

1 Solution

Accepted Solutions
sunny_talwar

I think you would need a calculated dimension here:

If([Rent end] < vFixdate, 'First Piece',

If([Rent end] < Date('01.01.2020'), 'Second Piece', 'Third Piece'))

and then use Sum(Payment) as your expression

View solution in original post

3 Replies
sunny_talwar

I think you would need a calculated dimension here:

If([Rent end] < vFixdate, 'First Piece',

If([Rent end] < Date('01.01.2020'), 'Second Piece', 'Third Piece'))

and then use Sum(Payment) as your expression

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

You should have dimension and expression as below.

Dimension

if([Rent end]< vFixdate, 'Before ' &vFixDate , if([Rent end] > vFixdate AND [Rent end] < date('01.01.2020'), 'Between ' &vFixDate  &' and ' & date('01.01.2020') , if([Rent end]<>date('01.01.2020'), 'After ' &date('01.01.2020') )))

And your expression should be

Sum(Payment)

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
sunny_talwar

Attaching a sample based on your provided data