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: 
Anonymous
Not applicable

Issue in Set Analysis with aggr

Dear Friends

I am using below expression to calculate the MTD which works correctly.

NUM(Count(DISTINCT{<Day={"<=$(=Day)"},ZONE={'EAST'},PRODUCT_BOOKING_STATUS={'BOOKED','UNDECIDED'},SUB_BUSINESS={'DOMESTIC'}>} LTCS.BFN))

However when I use the same expression for MTD in an expression which has aggr it does not work correctly.

Kindly let me know if there is any mistake or changes need to do to achieve the result.

sum(aggr(sum(DISTINCT {<ZONE={'EAST'},PRODUCT_BOOKING_STATUS={'BOOKED','UNDECIDED'},SUB_BUSINESS={'Domestic'},>} NO_ADULT),LTCS.BFN))

I am using these expressions in Text Object.

Thanks in advance.

Regards

Chintan

Hello Sunny I am able to get correct result by passing the modifiers before aggr as suggested by you. However the same thing is not working for the attached code in text obj as it is bit complex. Is there any way around to get the MTD result in atached code. Thanks & Regards Chintan

Message was edited by: Chintan Gala

1 Solution

Accepted Solutions
sunny_talwar

May be try this

Sum({<Day={"<=$(=Day)"}, ZONE = {'EAST'}, PRODUCT_BOOKING_STATUS ={'BOOKED','UNDECIDED'}, SUB_BUSINESS = {'Domestic'}>} Aggr(Sum(DISTINCT {<Day={"<=$(=Day)"}, ZONE = {'EAST'}, PRODUCT_BOOKING_STATUS ={'BOOKED','UNDECIDED'}, SUB_BUSINESS = {'Domestic'}>} NO_ADULT),LTCS.BFN))

View solution in original post

6 Replies
sunny_talwar

May be try this

Sum({<Day={"<=$(=Day)"}, ZONE = {'EAST'}, PRODUCT_BOOKING_STATUS ={'BOOKED','UNDECIDED'}, SUB_BUSINESS = {'Domestic'}>} Aggr(Sum(DISTINCT {<Day={"<=$(=Day)"}, ZONE = {'EAST'}, PRODUCT_BOOKING_STATUS ={'BOOKED','UNDECIDED'}, SUB_BUSINESS = {'Domestic'}>} NO_ADULT),LTCS.BFN))

Anonymous
Not applicable
Author

Hello Sunny

It gives the expected result.

Anonymous
Not applicable
Author

Hello Sunny I am able to get correct result by passing the modifiers before aggr as suggested by you. However the same thing is not working for the attached code in text obj as it is bit complex. Is there any way around to get the MTD result in attached code (notepad).


Thanks & Regards


Chintan

sunny_talwar

bit complex .... I have no idea what it's doing brother... especially looking at just the expression doesn't really tell me much... I wish I could help you, but without a sample it would be nearly impossible to decipher your expression

Anonymous
Not applicable
Author

  Sure, I will try something and if it does not work I will try to put a sample attachment with reduced data if possible.

Anonymous
Not applicable
Author

Hello Sunny

I have attached sample qvw with reduced data with a couple of text objects.If it provides some clarity to achive the MTD result.

Thanks & Regards

Chintan .