Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Annette1818
Contributor
Contributor

Calculated Field for Ageing

HI 

I am trying to create a calculated field for ageing. I created a field that calculates the Overdue age of an invoice and want to place it into buckets, below is my expression.  I do however get an error .

 

If([Overdue Age]<=30,'0-30',If([Overdue Age]>= 30 and[Overdue Age]<=60,'31-60',If([Overdue Age]>=61 and [Overdue Age]<=90,'61-90',If([Overdue Age]>=91 and [Overdue Age]<=120,'91-120',If([Overdue Age]>=121,'121+'),'120+'))))

I keep on getting an error of "Missing Right parenthesis)  

Please help

Thanks

Annette

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Try moving the ) behind '121+' to the end of the expression:

 

If([Overdue Age]<=30
	,'0-30'
	,If([Overdue Age]<=60
		,'31-60'
		,If([Overdue Age]<=90
			,'61-90'
			,If([Overdue Age]<=120
				,'91-120'
				,If([Overdue Age]>=121
					,'121+'
				)
			)
		)
	)
)

 

And might as well remove tests that are redundant.


talk is cheap, supply exceeds demand

View solution in original post

5 Replies
Sarkunelis
Partner - Contributor II
Partner - Contributor II

Hi, 

Does this works?

=If([Overdue Age]<=30, '0-30', If([Overdue Age]>=30 and[Overdue Age]<=60, '31-60', If([Overdue Age]>=61 and [Overdue Age]<=90, '61-90', If([Overdue Age]>=91 and [Overdue Age]<=120, '91-120', If([Overdue Age]>=121,'121+','120+' )))))

Annette1818
Contributor
Contributor
Author

HI

Thank you for the quick reply, no it does not, still getting error 

See below

 

2019-08-12 13_33_12-Invoices _ Data manager - Qlik Sense.png

 

 

Ezirraffner
Creator II
Creator II

Hi @Annette1818 

You can try this:

 

Pick(Match(-1, [Overdue Age] <= 30, [Overdue Age] > 30 and [Overdue Age] <= 60, [Overdue Age] > 60 and [Overdue Age] <= 90, [Overdue Age] > 90 and [Overdue Age] <= 120, [Overdue Age] > 120), '0-30','31-60','61-90','91-120', '121+')

 

 

Regards

 

Ezir 

Gysbert_Wassenaar

Try moving the ) behind '121+' to the end of the expression:

 

If([Overdue Age]<=30
	,'0-30'
	,If([Overdue Age]<=60
		,'31-60'
		,If([Overdue Age]<=90
			,'61-90'
			,If([Overdue Age]<=120
				,'91-120'
				,If([Overdue Age]>=121
					,'121+'
				)
			)
		)
	)
)

 

And might as well remove tests that are redundant.


talk is cheap, supply exceeds demand
Annette1818
Contributor
Contributor
Author

HI,


Thank you, this worked perfectly

 

Appreciate it

 

Annette