Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Annette1818
New 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
Highlighted
MVP & Luminary
MVP & Luminary

Re: Calculated Field for Ageing

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
5 Replies
Partner
Partner

Re: Calculated Field for Ageing

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
New Contributor

Re: Calculated Field for Ageing

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

 

 

Ezir
Contributor

Re: Calculated Field for Ageing

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 

Highlighted
MVP & Luminary
MVP & Luminary

Re: Calculated Field for Ageing

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
New Contributor

Re: Calculated Field for Ageing

HI,


Thank you, this worked perfectly

 

Appreciate it

 

Annette