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

Getcurrentfield in TOTAL expression

Hi,

My bar chart has 2 dimensions:

1.periods - cyclic selection

2. metric code (1-4)

expressions:

1.bar - order quantity

2.text - average duration of all segments for the current period (e.g., date)

I need to display an average for each column, according to a selected cyclic dimension.

But the following expression doesn't work, as all the values are the same.

sum(TOTAL <$(='[' & GetCurrentField([Cyc_SaleOrd_Periods]) & ']')> Order_OpenTarget_TimeDiff)

/count(TOTAL <$(='[' & GetCurrentField([Cyc_SaleOrd_Periods]) & ']')>  DISTINCT  SaleOrder_ID)

Would appreciate another way to display it...

Thanks!

bar_chart_total.png

Message was edited by: Dafnis X Attached sample data

12 Replies
dafnis14
Specialist
Specialist
Author

Hi Sergey,

So you offer to actually include all the fields in the group in the expression.

Thak you very much.

I didn't mark your answer as correct because it is a workaround.. 🙂

Thanks a lot!

Sergey_Shuklin
Specialist
Specialist

Hello, Dafnis!

It's a great experience to solve your problem. Thank you 😃

There is one more solution which can be the one you lookin' for:

=sum(total <$(=GetCurrentField(Periods))> Duration)/sum(total <$(=GetCurrentField(Periods))> [Qty Orders])

We've finnaly reached the GetCurrentField() function =D

dafnis14
Specialist
Specialist
Author

Kudos!

I have tried some variations of this expession which  but none worked!

Count(TOTAL <$(='[' & GetCurrentField([Group Name]) & ']')> [Respondent ID])

Thanks!