Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

New Contributor III

Age Calculation

Hi I have a date column A.

I want to write an expression where I am calculating age(Column B-Column A or Column B-Today() ) by using another column B.

Now I want to select column A and column B for age calculation if any value is selected from Column A and if no value is selected from column A then today's date should be selected.


Tags (1)
2 Replies

Re: Age Calculation

Try like:

Age( ColumnB , If( GetSelectedCount(ColumnA)=1, ColumnA, Today()))

Re: Age Calculation

You might be able to use this (with a slight issue)

Age(Column B, Alt(Column A, Today()))

The issue is that if in case for a particular selection there is only a single value for Column A, then it will pick Column A even if you have not explicitly selected it. In all other scenarios, this should work the same way as tresesco‌'s solution above.