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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Get avg($Field)

Hello,

I am designing a table based on ColumnNames. The target is to display all columns which are like '*LeadTime' as rows.

So i am using the dimensions as

=if(wildmatch($Field,'*LeadTime'),SubField($Field,'_',2))     -Workshop

=if(wildmatch($Field,'*LeadTime'),SubField($Field,'_',1))     -Previous Falg

I want to calculate average

So when i tried =avg($Field), it is not giving results as required.

2014-12-10_130154.png

Please suggest, how I can acheive this.

Thanks,

Deepa

15 Replies
Anonymous
Not applicable
Author

Hi Deepa ,

use this code in last column expression :

=if($Field ='Surfaced_HardCoating_Leadtime', avg(Surfaced_HardCoating_Leadtime),

if($Field ='Surfaced_TintingUV_Leadtime', avg(Surfaced_TintingUV_Leadtime),

if($Field ='Received_Beginning_Leadtime', avg(Received_Beginning_Leadtime),

if($Field ='Beginning_HardCoating_Leadtime', avg(Beginning_HardCoating_Leadtime),

if($Field ='Beginning_Surfaced_Leadtime', avg(Beginning_Surfaced_Leadtime),

if($Field ='Beginning_TintingUV_Leadtime', avg(Beginning_TintingUV_Leadtime),

if($Field ='Tinting_HardCoating_Leadtime', avg(Tinting_HardCoating_Leadtime)

)))))))

let me know if you are looking for something else

Anonymous
Not applicable
Author

See below example

anbu1984
Master III
Master III

$(=concat('if($Field=' & chr(39) & $Field & chr(39) & ',Avg({1}[' & $Field & '])', ',') & concat(right($Field&')',1)))

Chart with count of $Field values

Not applicable
Author

Hi,

Thanks for the reply.

Yes, it works.

Is there any work around for this, instead of checking for the if($Field=

anbu1984
Master III
Master III

Check my post above

marcus_sommer

What you are trying to do is to calculate results over fields which are in a crosstable-structure. Such calculations are possible but for the most calculations they are rather awkward and a "normal" data-structure would be better, maybe an additionally one.

http://community.qlik.com/blogs/qlikviewdesignblog/2014/03/24/crosstable

- Marcus