Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
Please suggest, how I can acheive this.
Thanks,
Deepa
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
See below example
$(=concat('if($Field=' & chr(39) & $Field & chr(39) & ',Avg({1}[' & $Field & '])', ',') & concat(right($Field&')',1)))
Hi,
Thanks for the reply.
Yes, it works.
Is there any work around for this, instead of checking for the if($Field=
Check my post above
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