Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
i want to count the number of lines where there is a difference between inventory and counted
sample data:
item name | date | inventory | conted |
---|---|---|---|
aaa | 22/8/2015 | 15 | 4 |
bbb | 13/7/2015 | 70 | 65 |
one time just to count the number of lines where there is a difference between inventory and counted
another value is the number of lines where inventory was larger
another value is the number of lines where inventoty was smaller
Use this expresison and let me know:
Sum(if(inventory<>counted,1,0)
Sum(if(inventory>counted,1,0)
Sum(if(inventory<counted,1,0)
try like this?
1)=count(If(Inventory<>Conted, ItemName))
2)
=count(If(Inventory>Conted, ItemName))
3)
=count(If(Inventory<Conted, ItemName))
Hi,
Need to know Inventory and ItemName are dimension or just field if they are field you can try this ways also with calculated dimension.
1. If(inventory = counted, 'Same','Not Same')
2. If(inventory > counted, 'Greater','Smaller')
Regards,
Anand
Hi Anand
hey are just field names
Hi,
I suggest you to create a new column during data loading that will contain "A" if the values are equal, a "B" if inventory > Counted and "C" if Inventory < Counted
LOAD
...
if (Inventory = Counted ,'A',if(Inventory > Counted,'B',if(Inventory < Counted, 'C'))) as [Type]
...
Then you can add 3 KPI counting each letter
Count(if(Type = 'A', Type))
Count(if(Type = 'B', Type))
Count(if(Type = 'C', Type))
Philippe
i preffer to do all the data manipulation in qlik that way when i work with my database i can have it all done without having to modify the data.
unless when i do a column it will automatically do the calculation when it loads the data from the database