Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
cbaqir
Specialist II
Specialist II

Conditional Dimension

I have a dimension called DOMAIN. There are two possibilities, ECISA and CAREB.

If the dimension called DESCRIPTION and the LAST_REVIEWED_DATE are the same, I want the DOMAIN to show as A/B instead of one line for ECISA and one line for CAREB. 

For example: DESCRIPTION = NICU (Neonatal) Admission

2019-04-01_13-20-48.jpg

If the dimension called DESCRIPTION and the LAST_REVIEWED_DATE are NOT the same, I want the DOMAIN on one line for ECISA and one line for CAREB. 

For example, DESCRIPTION = Heparin Infusion for ACS/Vascular (Xa)2019-04-01_13-20-03.jpg

Can someone please help me?

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar

Try this

=Aggr(If(Count(TOTAL <DESCRIPTION> DOMAIN)>1 and Count(DISTINCT TOTAL <DESCRIPTION> LAST_REVIEW_DATE) = 1,'A/B',DOMAIN), DESCRIPTION, DOMAIN)

View solution in original post

5 Replies
Anil_Babu_Samineni

Perhaps this?

sum(aggr(Sum({$<DOMAIN = {'A'}>}USAGE),DOMAIN,GOVERNING_CCG,DESCRIPTION,LAST_REVIEW_DATE))/sum(aggr(Sum({$<DOMAIN = {'B'}>}USAGE),DOMAIN,GOVERNING_CCG,DESCRIPTION,LAST_REVIEW_DATE))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
cbaqir
Specialist II
Specialist II
Author

I am not sure why there is "/" nor the sum function. Can you help me understand?
cbaqir
Specialist II
Specialist II
Author

@sunny_talwar Any idea?

sunny_talwar

Try this

=Aggr(If(Count(TOTAL <DESCRIPTION> DOMAIN)>1 and Count(DISTINCT TOTAL <DESCRIPTION> LAST_REVIEW_DATE) = 1,'A/B',DOMAIN), DESCRIPTION, DOMAIN)
cbaqir
Specialist II
Specialist II
Author

OMG THANK YOU!!!