Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
bushpalaamarnat
Creator
Creator

Count Calculation error

Hi,

in back end, i have a naming done,  as material & customer & supplier as %key,

For the same combination in the excel data it say 50, and when extracted from the qlik also it say's 50.

How ever in the table when given count (%Key) i get total as 70, which is more then 50 the actual count.

Total field is the one that does the count.

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

May be use Distinct in Counting them.

Provide some more info so that we can help you.

View solution in original post

3 Replies
MK_QSL
MVP
MVP

May be use Distinct in Counting them.

Provide some more info so that we can help you.

bushpalaamarnat
Creator
Creator
Author

Hello Sir,

This is my script, for now let me know this helps.

WeeklyCorridor:

Left join

LOAD

Week,

[Supplier Loc] & [Customer Loc] &  Material as %key,

[Customer Loc] &  Material as %key2,

     Material,

     [Material Description],

     [Material Type],

     Category,

[Inventory Volume],

     [Demand Volume (Eaches)],

     DFC,

     Brand,

     Variant,

     Lifecycle,

     [Customer Loc],

     [Customer Location Description],

     [Customer Zone],

     [Supplier Loc],

     [Supplier Gov BU],

     [Corridor Status],

     [Min DFC],

     [Max DFC],

      if([Safety Days Supply]='-',0,[Safety Days Supply]) as [Safety Days Supply],

    

     //Creation of rules 

 

    IF(((num([Min DFC])+ num([Max DFC]))<> 0) and num([Min DFC]) >= num([Max DFC]),'Reason- Min >= Max')              as Rule1,

    IF(num([Safety Days Supply]) >= num([Max DFC] ), 'Reason-SSD>Max') as Rule2,

    IF(((num([Min DFC])+ num([Max DFC]))=0 AND num([Safety Days Supply]) <> 0),'Reason-SSD has value when Min & Max is zero')    as Rule3,

    If((num([Min DFC]) + num([Max DFC]))=0,'Reason-Min Max not set') as Rule4,

    IF( Lifecycle='Material Run Down' and (num([Min DFC])+ num([Max DFC]))<>0, 'Reason-RunDown SKU Min & Max > Zero') as Rule5,

    IF(num([Safety Days Supply]) <= num([Min DFC]), 'Reason-SSD <= Min')      as Rule6,

    IF([Safety Days Supply]='-' and num([Max DFC])>0, 'Reason-SSD not set') as Rule7,

    IF([Safety Days Supply]='-' and (num([Min DFC])+ num([Max DFC]))=0, 'Min & Max = Zero')          as Rule8,

    if([Min DFC]='-' and [Max DFC]='-','Reason-Min Max not set') as Rule9,

bushpalaamarnat
Creator
Creator
Author

Hi Sir,

How do i use distinct in this formula

sum(if(Inventory_Position='Overstock',1,0))