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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Help to "count" or "sum" function

Hi All

I need some help in a Count - funtion.

I have succeded to do this formular

=count(DISTINCT if(DCU.Site='C190',
(
if(fabs(round(RangeMax(DCU.Length,DCU.Width,DCU.Height),0.001)-round(RangeMax(CAR.Length,CAR.Width,CAR.Height),0.001))

<= round(RangeMax(DCU.Length,DCU.Width,DCU.Height),0.001)*("vDiff_%_L-W-H")
    
and fabs(round(RangeAvg(DCU.Length,DCU.Width,DCU.Height),0.001)-round(RangeAvg(CAR.Length,CAR.Width,CAR.Height),0.001)) <= round(RangeAvg(DCU.Length,DCU.Width,DCU.Height),0.001)*("vDiff_%_L-W-H")
      
and fabs(round(RangeMin(DCU.Length,DCU.Width,DCU.Height),0.001)-round(RangeMin(CAR.Length,CAR.Width,CAR.Height),0.001)) <= round(RangeMin(DCU.Length,DCU.Width,DCU.Height),0.001)*("vDiff_%_L-W-H")
         
and  fabs(DCU.Volume-CAR.Volume) <= DCU.Volume * ("vDiff_%_Volume"
               
and  fabs(DCU.Weight-CAR.GrossWeight) <= DCU.Weight * ("vDiff_%_Weight")
                    
and CAR.CollieSize=DCU.SKU
                ,0,
Article))))-1

But this formular it will not show correct. What I'm i doing wrong? There is no "red mark" where there should be a wrong expression.

=Count(DISTINCT if(count(if(Len(Article)=9,Article)) <> CAR.Denom.,'',
    
if(fabs(CAR.GrossWeight-round(sum(if(Len(Article)=9,DCU.Weight))/(count(if(Len(Article)=9,Article))),0.001))

<= round(sum(if(Len(Article)=9,DCU.Weight))/(count(if(Len(Article)=9,Article))),0.001)* ("vDiff_%_Weight")
          
and fabs(round(CAR.Length-pow(sum(if(Len(Article)=9,DCU.Volume))/count(if(Len(Article)=9,Article)),1/3)*100,0.01)) <= round((pow(sum(if(Len(Article)=9,DCU.Volume))/count(if(Len(Article)=9,Article)),1/3)*100),0.01) * ("vDiff_%_L-W-H")
               
and fabs(CAR.Volume-round((sum(if(Len(Article)=9,DCU.Volume))/count(if(Len(Article)=9,Article))),0.001)) <= round(sum(if(Len(Article)=9,DCU.Volume))/count(if(Len(Article)=9,Article)),0.001) * (vDiff_%_Volume)
                ,0,
Article)))-1

Best regards

Bjarne

1 Reply
Not applicable
Author

If "vDiff_%_L-W-H" is a variable then try replacing with $(vDiff_%_L-W-H).

Likewise do for other variables as well.

Kiran.