Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Define Dimension for AGGR function from calculated Dimension in Cycling Group

Hello.

As a extension of this thread

I have a Chart (table) with Cyclic Group as a Dimension.

I Have two views in the groups and I need to change calculations based on wich Dimension is activated.

I can use something like =aggr(SUM(TransactionAmount), $(=GetCurrentField(PROPD_Cycling_Group)))

but this time I use calculated dimension in my Cycling group

so

=GetCurrentField(PROPD_Cycling_Group_Analytical_View) returns me =if(TransactionAmount > 0, ItemDescription) and I can't use it as a dimension for aggr function.

I tried

=Replace(Mid(GetCurrentField(PROPD_Cycling_Group_Analytical_View), 28),')','') wich returns me ItemDescription - exactly what i'd like to use as a dimension.

but how to pass this as an argument to aggr?

I tried =aggr(Sum(TransactionAmount), $(=Replace(Mid(GetCurrentField(PROPD_Cycling_Group_Analytical_View), 28),')',''))

but it's not working

Сообщение отредактировано: Aleksander Panfilenok

6 Replies
MK_QSL
MVP
MVP

Can you upload your sample file or apps?

Not applicable
Author

Hello Manisha

I've attacked the document to my original message

MK_QSL
MVP
MVP

hope this help

Not applicable
Author

Hello Manish

I'm trying to reach the calculation when column3 is equals to column2

Capture.PNG.png

So the aggr column should be exactly same as sum column

MK_QSL
MVP
MVP

Can you give an example or a desired output...

jerem1234
Specialist II
Specialist II

Your original formula doesn't work because when you do $(=...), its reading the parentheses ')' as one of the closing parentheses instead of a parameter to your replace function, this should work:

Aggr(Sum(Amount), $(=Replace(Mid(GetCurrentField(MyCyclicGroup), 17), '$(=chr(41))','')))

Or you may avoid that with:

Aggr(Sum(Amount), $(=left(Mid(GetCurrentField(MyCyclicGroup), 17), 11)))

But if you want the same thing, why not just copy the equation into another expression? That way you'll have two columns with the same thing. So have two sum(Amount) expressions.

Hope this helps!