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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

variable in text box

Hi All,

I have a variable that works out an average for me, i am using this in a straight table with a product dimension then i have the totals summed up giving me a total of all the averages.  (Top table below)

Does anyone know how i can use the variable in a text box but displaying the total instead

this is my variable

$(vTargetAvg_Listings)

=

avg({$<

[it_target_type]={"Listings"},

[ld_Dist]={"4"},

[ld_Outlet_Check_Date]={">=$(=Timestamp(FirstDayCurrentFiscalYear))"}

>}

[it_target_value]

)

Capture.JPG

1 Solution

Accepted Solutions
swuehl
MVP
MVP

You'll probably need to use advanced aggregation, i.e. the aggr() function, maybe like this:

=sum(

aggr(

avg({$<
[it_target_type]={"Listings"},
[ld_Dist]={"4"},
[ld_Outlet_Check_Date]={">=$(=Timestamp(FirstDayCurrentFiscalYear))"}
>}
[it_target_value]
)

,Brand )

)

View solution in original post

2 Replies
swuehl
MVP
MVP

You'll probably need to use advanced aggregation, i.e. the aggr() function, maybe like this:

=sum(

aggr(

avg({$<
[it_target_type]={"Listings"},
[ld_Dist]={"4"},
[ld_Outlet_Check_Date]={">=$(=Timestamp(FirstDayCurrentFiscalYear))"}
>}
[it_target_value]
)

,Brand )

)

Not applicable
Author

Great, thanks for the answer