Jump to content
  • 0

Group Data Across Columns


alanhoffman
 Share

Question

Hi there Caspio gurus...

 

I have a table: Orders..

 

In this table is a variety of columns holding data in columns:

 

Orders_Food_Order_1

Orders_Food_Qty_1

 

Orders_Food_Order_2

Orders_Food_Qty_2

 

Orders_Drink_Order_1

Orders_Drink_Qty_1

 

Orders_Drink_Order_2

Orders_Drink_Qty_2

 

The Food_Order and Drink_Order fields are text and hold different food and drink orders from different customers and may hold the same data in different columns

 

eg for Food

                       Order 1       Qty 1    Order 2      Qty 2     Order 1   Qty 1    Order 2   Qty 2

 

Customer 1:  HotDog          1          Fries             2         Shake      1           Coke       1

Customer 2:  Fries               2         Burger           2

Customer 3:  OnionRings     1        HotDog          1         Coke       1

Customer 4:  Burger             2         OnionRings   1

 

 

What I would like to be able to do is aggregate this data so that I can perform calculations on that data - specifically how many orders for each type of food?

ie

Burger: 4

Fries: 4

HotDog: 2

OnionRings: 2

Shake: 1

Coke: 2

 

 

Any assistance would be greatly appreciated..

 

Cheers..

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Hello alanhoffman,

 

I would recommend you to create the 'Orders' table:

 

Customer     Order            Qty

Customer1   HotDog           1

Customer1   Fries               2

Customer1   Shake             1

Customer1   Coke               1

Customer2   Fries               2

Customer2   Burger            2

Customer3   OnionRings    1

Customer3   HotDog           1

Customer3   Coke               1

Customer4   Burger            2

 

Than you can create Tabular DataPage, group by 'Order' field and add the aggregation field that summarize the values of 'Qty' field and select to calculate aggregation for the first group.

 

Hope it helps.

 

IREN

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...