Forum Discussion

ProcessDistille's avatar
ProcessDistille
Qrew Member
3 years ago

Unconsolidate records based on qty?

Hello,

I am wondering if there is a solution for the following:

If the qty entered is more than 1, Id like to make a duplicate record for the # of qty entered. Meaning, if someone enters a qty of 3, I want it to create 3 individual records with the qty of 1. Maybe this is possible through quickbase actions or pipelines?

------------------------------
Process Distillery
------------------------------

3 Replies

  • After many hours I have figured this out. If anyone would like a detailed explanation of how to accomplish this,. please let me know and I'll respond accordingly

    ------------------------------
    Process Distillery
    ------------------------------
    • MarkShnier__You's avatar
      MarkShnier__You
      Icon for Qrew Legend rankQrew Legend
      Yes, I'd love to know the gist of your solution.  Does not need to be detailed step by step but at least in general how you solved it.

      ------------------------------
      Mark Shnier (YQC)
      mark.shnier@gmail.com
      ------------------------------
      • ProcessDistille's avatar
        ProcessDistille
        Qrew Member
        I'm not sure if this is the best way of going about it, but it worked for me so something must be right. 

        In the table you want to have the unconsolidation happen (Going to call this "Table 1"):
        1. Create a text field called "Uncondensed // PIPELINE CONNECTOR" (The name of the field has no effect, this is just how I name fields that are used in my pipelines and actions)
        2. Set the default value of the field to "YES"

        Create pipeline 
        1. Set the trigger as "record created", set the table to Table 1, set the query to "Qty is greater than 1", "Uncondensed // PIPELINE CONNECTOR equals YES", and "Related Parent Record is set"
        2. Next, "Create Record". Choose the fields you need to copy, "Related Item",  "Uncondensed // PIPELINE CONNECTOR", "Quantity" 
        3. Drag & drop "related Item" from A into the "related item" box
        4. Write the value "COPY" into "Uncondensed // PIPELINE CONNECTOR"
        5. Write the value "1" into "Quantity" 
        6. Insert a condition
        7. Set the query to "Qty is greater than 2", "Uncondensed // PIPELINE CONNECTOR equals YES", and "Related Parent Record is set"
          • After this you will repeat step 2-7, only thing you need to change is the query. "Qty is greater than X", and each time you add a condition, increase X by 1 each time.
        *The ELSE statement will always be "Stop Pipeline"
        I found that after I got to (Qty is greater than 10) the pipeline would slowdown. So I made the original Quantity field in Table 1 a list 1-10 and prevented entry greater than that.

        After this was done I noticed it would work; However, It would always be 1 qty short, so I had to make another pipeline to fix this

        Create pipeline 2
        1. Set the trigger as "record created", set the table to Table 1, set the query to "Qty is greater than 1", "Uncondensed // PIPELINE CONNECTOR equals YES", and "Related Parent Record is set"
        2. Next, "Create Record". Choose the fields you need to copy, "Related Item",  "Uncondensed // PIPELINE CONNECTOR", "Quantity" 
        3. Drag & drop "related Item" from A into the "related item" box
        4. Write the value "COPY" into "Uncondensed // PIPELINE CONNECTOR"
        5. Write the value "1" into "Quantity" 

        The combination of Pipeline 1 & Pipeline 2 allowed be to create duplicates (up to a qty of 10).

        The Parent Table
        1. Assuming you already have a "Consolidated" report link (I'll call this report link 1)
        2. Edit the report that report link 1 displays with the filter
          • All of these conditions are true Uncondensed // PIPELINE CONNECTOR contains the value YES
          • This will bring back the Consolidated list of item
        3. Copy the Report in Table 1
        4. Edit the report with the filter
          • All of these conditions are true Quantity is equal to 1
          • This will bring back the Unconsolidated list of item
        5. Copy Report link 1 and have it pull the copied report

        Im almost positive there is a better way to do this, and I'll be actively working on this to see if there is. But for now this allows me to have a consolidated and unconsolidated view of fixtures from a child table on the parent table

        TLDR: I used Pipelines to copy the item if the qty is greater than 1 (up to 10) using specific query. Then created reports to bring back the consolidated and unconsolidated list.

        ------------------------------
        Process Distillery
        ------------------------------