Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
narender123
Specialist
Specialist

2 aggr function in single expression

Hi Team,

I have two database (old and new database).suppose database 1 have the amount up to mid of the 2015 year.

Database 2 have amount start from mid of the 2015 year.

So I have merged both database dimensions,amount etc.

Expression is:

=aggr(sum({<Flag={'B'}>}TOT_TAX_AMT),TAX_CODE)+sum({<Flag={'A'}>}aggr(only(TOTAL_REVENUE),key))

Both database sum is shown in upper expression.

You can see aggr is used in both parts of the expression. Due to 2 aggr function in the single expression, the year 2015 amount is not showing on the table. But for 2017,2016,2014,2013, the amount is coming in the report.

Note: I am not taking dimension in the table, I am only showing expression in table.

Please tell me how to sort out this problem.

Thanks,

Narender

7 Replies
stabben23
Partner - Master
Partner - Master

Hi,

could it be that you just need to aggregate the first Expression:

sum(aggr(sum({<Flag={'B'}>}TOT_TAX_AMT),TAX_CODE))+sum({<Flag={'A'}>}aggr(only(TOTAL_REVENUE),key))

Anil_Babu_Samineni

If DB1 and DB2 same structure and then call up using concatenate

DB1:

Select Flag, TOT_TAX_AMT, TAX_CODE, Key;

DB2:

Select Flag, TOTAL_REVENUE as TOT_TAX_AMT, Key;

Then may be this?

Aggr(Sum({<Flag = {'A', 'B'}>} TOTAL_REVENUE),Key)

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
narender123
Specialist
Specialist
Author

Hi Johansson,

It is Showing wrong data.

Thanks,

Narender

narender123
Specialist
Specialist
Author

Hi Anil,

Both db has different structure.

Thanks,

Narender

Anil_Babu_Samineni

Would you share sample application

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
narender123
Specialist
Specialist
Author

Hi Anil,

I cant share with you.Because it has multiple dimension and script created in multiple phases.

Peter_Cammaert
Partner - Champion III
Partner - Champion III

No problem. We only need the final QVW without script or DBs.