查找丢失的数据 [英] Find Missing Data

查看:47
本文介绍了查找丢失的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在跳跃有人可以帮助我完成我需要的工资单项目

工具。


开始我们处理工资核算期。所以我们正在处理一个

确切的10天(周一到周五,2周)。


我有一个数据集如下(1周保存它简短):


员工1 - 日期1

员工1 - 日期2

员工1 - 日期3

员工1 - 日期4

员工1 - 日期5

员工2 - 日期1

员工2 - 日期3

员工2 - 日期4

员工2 - 日期5


您会注意到员工2 - 日期2丢失。我需要开发一个例行程序,每个员工都会错过日期。


我对任何想法/理论持开放态度。我有自己的一个但是在我开始之前我已经想要了一些意见。我不确定这样的例行程序会有多高效。

这听起来像一个集群f。给我。

创建一系列独特的员工编号


然后


循环
$ b通过该数组$ b并创建第二个唯一日期数组。如果该第二个数组的未提取的
是< 9然后找出错过的日期(我有期间

开始)。将员工编号和日期转储到第三个数组中。摧毁第二个

数组。

下一页

想法?

解决方案

< blockquote>嗨Justin,


我假设每个日期都是一行。


看到这个比有两个问题,你想知道是否还有日期

缺失,这很容易,您在员工的数据视图中设置员工,

计数应始终为10.


比你可以显示哪些日期,它应该比每个程序员更好

很容易知道缺少什么。


(我首先会制作一个数组,其中的日期应该是并且测试什么时候

是一个缺失的数组。该数组因为你必须处理周末可以使用

使它变得复杂你是在每次

日期的直接例行计算中做到的。


我认为你不必测试双打,当然这是

数据视图也是一块蛋糕。


或我觉得这很简单吗?


Cor


您是否考虑过创建校验和?

对于I = 1到10

''将数据解析为行(即:第一行将是员工1 - 日期

1)

Do Until Right


(line,I)= I

Missing = Missing + 2 ^(I - 1)

I = I + 1''双重执行

循环

''(这是一个循环因为可能连续缺失

记录)

''在正确的位置保存数据,如果数据丢失,计数器已经更新以反映这一点,并且'''数据仍将存储在

对应索引的索引

接下来我


''现在你有一个Missing变量,这在所有场合都是独一无二的。我猜你不需要解释如何再次读取变量并想出

缺少的链接...如果你这样做,请再次发布,我我会尽力帮忙。

顺便说一句:这是一个不需要太多内存的解决方案(只有1

整数,它保存校验和)。如果你宁愿使用更少的处理器

的方法(你需要再次读取这个变量),那么你可能会认为只需存储所有的数字缺少行数组,

可能会快一点。虽然不多,而且需要额外的内存。

我猜测日期之间的区别等等不会像
描述(即:线条不会以''日期1'结尾,但有一个真实的

日期),但你可以随时加载所谓的正确日期到一个数组

,然后检查输入是否匹配数组(I)。


希望这有帮助并且不会太模糊,我是不太好解释事情...


John

---

外发邮件已通过AVG 6.0认证无病毒

由AVG反病毒系统检查( http://www.grisoft。 com)

版本:6.0.716 /病毒库:472 - 发布日期:5-7-04


I''m hopping someone can help me out on a payroll project I need to
implement.

To start we are dealing with payroll periods. So we are dealing with an
exact 10 days (Monday - Friday, 2 weeks).

I have a dataset as follows (1 week to keep it short):

Employee 1 - Date 1
Employee 1 - Date 2
Employee 1 - Date 3
Employee 1 - Date 4
Employee 1 - Date 5
Employee 2 - Date 1
Employee 2 - Date 3
Employee 2 - Date 4
Employee 2 - Date 5

You''ll notice Employee 2 - Date 2 is missing. I need to develop a routine
that will give me all missed dates per employee.

I''m open to any ideas/theories. I have one of my own but before I get
started on it I wanted some opinions on it. I''m not sure how productive
such a routine will be. It sounds like a cluster f. to me.
Create an array of unique employee numbers

then

Loop
through that array and create a second array of unique dates. If the ubound
of that second array is < 9 then figure out missed date(s) (I have period
start). Dump employee number and date into a third array. Destroy second
array.
Next
Thoughts?

解决方案

Hi Justin,

I assume every date is a row.

Seeing this than there are two question, you want to know if there are dates
missing, that is easy, you set them employee by employee in a dataview, the
count should always be 10.

Than you can show which dates are there, it should than for every programmer
be very easy to know what is missing.

(I would first make an array with dates which should be and test when there
is a missing one. The array because you have to deal with weekends which can
make it complex when you do it in a direct routine calculating everytime the
dates)

I assume that you do not have to test on doubles, which is of course with
that dataview as well a piece of cake.

Or do I see this the simple?

Cor


Have you thought about creating a checksum?
For I = 1 To 10
'' parse data into line (ie: first line would be "Employee 1 - Date
1")
Do Until Right


(line, I) = I
Missing = Missing + 2^(I - 1)
I = I + 1 ''double execute
Loop
'' (This is a loop because there might be consecutive missing
records)
'' save data at right spot, if data was missing, the counter has been
updated to reflect that, and '' data will still be stored at the
index corresponding to the Index
Next I

'' Now you have a Missing variable, which is unique for all occasions. I
guess you don''t need explanations how to read the variable again and figure
out the missing links... if you do, post here again, and I''ll try to help.
BTW: this is a solution which doesn''t require too much memory (only 1
integer which holds the checksum). If you''d rather have a less processor
consumtive way (you will need to read this variable again), then you might
consider just storing the numbers of all the missing lines into an array,
which might be a bit faster. Not much though, and it will take loads of
extra memory.
I''m guessing the distinguishing between dates etc. won''t be as easy as
described (ie: the lines won''t just end with ''date 1'', but with a real
date), but you can always load the supposedly correct dates into an array
and then examine if the input matches array(I).

Hope this helps and wasn''t too fuzzy, I''m not great at explaining things...

John
---
Outgoing mail is certified Virus Free by AVG 6.0
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.716 / Virus Database: 472 - Release Date: 5-7-04


这篇关于查找丢失的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆