CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2003
    Posts
    44

    2-Way Analysis Reports ???

    Hello. I need some help from you guys in creating a 2-way analysis report with VB.NET. I am working with a flat file (with fixed fields) and need to create an analysis on 2 different fields. Below is a file example to better explain my problem.

    FILE EXAMPLE:
    Fields:
    positions (1-10) = TYPE
    positions (11-20) = FRUIT
    positions (21-25) = ANIMAL

    ABC123 apple dog
    ABC124 peach cat
    ABC125 grape horse
    ABC125 peach dog
    .....................................

    I want to run an analysis on the fields TYPE by ANIMAL (and ignor FRUIT). and get the following results.

    cat dog horse TOTAL
    ABC123 0 1 0 1
    ABC124 1 0 0 1
    ABC125 0 1 1 2

    TOTAL 1 2 1 4

    Once I have these results I need to import them into Excel usingthe .COM reference which I know how to if I am only importing on on field. But If i am importing on 2 fields like this how do I keep it staight on what corresponds with what,and keep everything in the correct order?

    I am thinking that the best way do to this would be to use a hashtable, which I have uses before many time. But I dont know how to do this with multiple fields. I know this was a little confusing, so if you need me to explain anything a little bit clearer just ask. Any help would be greatly appredciated.

    Thanks,
    Brian.

  2. #2
    Join Date
    Feb 2003
    Posts
    44
    Let me fix that file example...and the results...as the some how go formatted funny.

    FILE EXAMPLE:
    Fields:
    positions (1-10) = TYPE
    positions (11-20) = FRUIT
    positions (21-25) = ANIMAL

    ABC123 apple dog
    ABC124 peach cat
    ABC125 grape horse
    ABC125 peach dog

    Results:

    cat dog horse TOTAL
    ABC123 0 1 0 1
    ABC124 1 0 0 1
    ABC125 0 1 1 2

    TOTAL 1 2 1 4

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured