Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

lejours88
Contributor

Ask for Expression

Hi,

I have a data like this:

   

ITEM_IDPART_IDDATEAVG_RHCalculation
PP112-Feb-20187288.219505.7 - 7288.21
PP114-Feb-20187288.219505.7 - 7288.21
PP106-Jun-20188726.469505.7 - 7288.21
PP113-Aug-20189505.79505.7 - 7288.21
PP205-Jan-20186732.47288.21-6732.4
PP222-Jan-20187060.957288.21-6732.4
PP229-Jan-20187162.557288.21-6732.4
PP205-Feb-20187267.17288.21-6732.4
PP212-Feb-20187288.217288.21-6732.4

I want to get AVG_RH value in max(DATE) and Min(DATE) for each ITEM_ID and PART_ID.

For example ITEM_ID = P and PART_ID = P1

I want to get AVG RH in MAX DATE (13-Aug-2018) and MIN DATE(12-FEB-2018) so the result must be in Calculation column above.

Can somebody help me.

Thanks

1 Reply
andrey_krylov
Valued Contributor

Re: Ask for Expression

Try this

Only(TOTAL <ITEM_ID, PART_ID> Aggr(If(Max(TOTAL <ITEM_ID, PART_ID> DATE) = DATE,  AVG_RH), ITEM_ID, PART_ID, DATE)) & ' - ' & Only(TOTAL <ITEM_ID, PART_ID> Aggr(If(Min(TOTAL <ITEM_ID, PART_ID> DATE) = DATE,  AVG_RH), ITEM_ID, PART_ID, DATE))