table count duplicates

  • 1
  • Question
  • Updated 2 years ago
  • Answered
I have a table and have column that I would like to identify duplicate numbers.  In excel I can use an "if" statement to compare the 2 fields in adjacent rows.  Is there a method to do that in Skuid table?
Photo of Bill Fox

Bill Fox

  • 8,990 Points 5k badge 2x thumb

Posted 2 years ago

  • 1
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 18,656 Points 10k badge 2x thumb

You can add a UI only formula field to your model with conditional logic as explained in the above link.
Photo of Bill Fox

Bill Fox

  • 8,990 Points 5k badge 2x thumb
Hello Raymond,

 Can you point out the section that compares data from two different rows.  I see data from the same row, but not different rows.
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 18,656 Points 10k badge 2x thumb
I must have missed your question(even though now When I read it it seems pretty clear).....
the only practical way I can think to do this without JavaScript would be to create a second model, then ad a row action that sets a condition a condition on the second model so that it only returns rows that have a value equal to the value in the field you are trying to find duplicates on. Then have a table display the rows from the second model in a popup.
Photo of Bill McCullough

Bill McCullough, Champion

  • 13,822 Points 10k badge 2x thumb

This is a variation on something that Zach McElrath posted.  Skuid generates an 'index' merge variable on a table.  You can use this with some formula fields to look one row ahead (or behind) for comparisons.  Use the Model Lookup function along with the IndexPlus (index +1) field to look one row ahead and retrieve the same value.

Here are the key formula fields:




Here is a sample page based on Opportunity that you can try to see it in action:

<skuidpage unsavedchangeswarning="yes" personalizationmode="server" useviewportmeta="true" showsidebar="false" showheader="false" tabtooverride="Opportunity">
        <model id="Opportunity" limit="100" query="true" createrowifnonefound="false" datasource="salesforce" sobject="Opportunity">
                <field id="Name"/>
                <field id="CreatedDate"/>
                <field id="StageName"/>
                <field id="Amount"/>
                <field id="CloseDate"/>
                <field id="MoreThanNextRow" uionly="true" displaytype="FORMULA" label="MoreThanNextRow" ogdisplaytype="TEXT" readonly="true" returntype="TEXT">
                <field id="Index" uionly="true" displaytype="FORMULA" label="Index" ogdisplaytype="TEXT" readonly="true" returntype="DOUBLE" precision="9" scale="0">
                <field id="IndexPlus" uionly="true" displaytype="FORMULA" label="IndexPlus" ogdisplaytype="TEXT" readonly="true" returntype="DOUBLE" precision="9" scale="0">
                        <action type="custom" snippet="newSnippet"/>
        <pagetitle model="Opportunity" uniqueid="sk-3x6o-e-199">
                <action type="savecancel" uniqueid="sk-3x6o-d-197"/>
        <skootable showconditions="true" showsavecancel="false" searchmethod="server" searchbox="true" showexportbuttons="false" pagesize="10" createrecords="true" model="Opportunity" mode="read" allowcolumnreordering="true" uniqueid="sk-3x6o-y-213">
                <field id="Name" hideable="true" allowordering="true" uniqueid="fi-3x6nIq-914">
                    <renderconditions logictype="and" onhidedatabehavior="keep"/>
                <field id="CloseDate" hideable="true" uniqueid="fi-2t8z-402" allowordering="true"/>
                <field id="StageName" hideable="true" uniqueid="fi-3x6rFe-255">
                    <renderconditions logictype="and" onhidedatabehavior="keep"/>
                    <enableconditions logictype="and"/>
                <field id="Amount" hideable="true" uniqueid="fi-3xbN-394"/>
                <field id="MoreThanNextRow" hideable="true" uniqueid="fi-3xXO-589"/>
                <field id="Index" hideable="true" uniqueid="fi-3xXd-728"/>
                <field id="IndexPlus" hideable="true" uniqueid="fi-3xYi-988"/>
                <action type="edit"/>
                <action type="delete"/>
            <massactions usefirstitemasdefault="true">
                <action type="massupdate"/>
                <action type="massdelete"/>
                <view type="standard"/>
        <actionsequences uniqueid="sk-3x6rFZ-252"/>
        <styleitem type="background" bgtype="none"/>