Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld 2022, LIVE in Denver CO., May 16-19, 2022. REGISTER NOW TO RECEIVE EARLY BIRD PRICING
cancel
Showing results for 
Search instead for 
Did you mean: 
chitemerere
Specialist
Specialist

Use of Aggr Max

I have the following straight table:

ConstrainingPatentNumber.JPG

I need to have a calculated dimension named "Constraining Patent" based on the dimensions 'Patent Number', 'DrugSubstanceFlag' and and 'Patent Expiry Date'.

The "Constraining Patent" is the 'Patent Number' where 'DrugSubstanceFlag' is equal to 'Y' and the maximum of the 'Patent Expiry Date'.  In this case it should be 8946235 because it has the highest 'Patent Expiry Date'.

I used the following as a calculated dimension:

=if(GDrugSubstanceFlag = 'Y',Aggr(Max(GPatentNumber, GFPatentExpiryDate),GFPatentExpiryDate))


and this gives me the following results which are not what i am looking for as explained above.


ConstrainingPatentNumberTwo.JPG


How can this be accomplished?


Regards.


Chris


2 Replies
chitemerere
Specialist
Specialist
Author

I have tried the following and it does not work:

=Aggr(Max({<GDrugSubstanceFlag = {'Y'}>}GPatentNumber),GFPatentExpiryDate)


Regards


Chris


Anil_Babu_Samineni

Try this? And Don't forget do Suppress When value is null "For that Calculated Dimension"

If(GFPatentExpiryDate=Max(TOTAL GFPatentExpiryDate) and GDrugSubstanceFlag = 'Y', GPatentNumber)

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)