Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForm and ListForm and ListUsing Calculated Column to add up hidden column valuesUsing Calculated Column to add up hidden column values
Previous
 
Next
New Post
6/29/2012 6:09 PM
 

I figured out how to set a drop down box with captions and values.  However, I can't figure out how to add the values together.


For example:

Registration

Type: Text
List Of Values: Member - $25|25;Non-Member - $50|50;Student - $0|0
Drop-down list

Lunch

Type: Text
List of Values: No lunch - $0|0;Vegetarian - $10|10;Chicken - $10|10;Beef - $12|12
Drop-down list


Now, let's say I want a column with Total Due.  

For example, the calculated column for someone who selects Member and Vegetarian should have a total of $35

Someone who selects Student and Beef should have a total of $12

I've tried numerous combinations of hidden columns but can't get anything to work.

My questions are:

1. How do I add up [Registration].value+[Lunch].value?  I've tried [Registration+_UDT_Value] and [Registration]+_UDT_Value and [Registration_UDT_Value] and various other combinations but can't seem to get the right syntax.  Any help with syntax?

2. When I have a Value defined, the form shows the caption, but the list shows the value after an item has been submitted.  If both the chicken lunch and the vegetarian lunch cost the same... how do I know which is which?  Can I only use the hidden columns for the calculated column, and display the caption in the list?

3. As noted in #2 above, the values are actually displayed in the list rather than the captions.  The captions would be the desired display.  Youo would think this would make it easier to add up the columns.  However, when I add up [Registration]+[Lunch] in a calculated column... even if integer is selected.. I get the 2 sets of numbers in a string; rather than the sum.  For example, Member ($25) plus Beef ($12) results as $2512 rather than $37


Thanks for any help with syntax and setup!





 
New Post
6/29/2012 6:19 PM
 

Hmm.. One issue solved.  Registration and Lunch columns need to be Integer, not text.  You can still define a caption for display in the dropdown box.

The calculated column can also be an integer.


So, I got the addition to add up.  Now I don't know how to display the caption, rather than the value, in the "Registration" and "Lunch" columns.  

 
New Post
7/5/2012 8:49 AM
 

I did something like this.  Hope it helps you configure something which works for you.

"Group" is actually a text column and it's configured for a drop-down box.  The drop-down entries are configured as such: "General Documents|1;Instructions|2", etc.  I set this up so that the entries are displayed in a certain order instead of alphabetically.  I'm sorting by their selected values (1, 2, 3, etc.).

<xsl:template match="/udt:UserDefinedTable">
    <ul class="PlansListing">
    <xsl:for-each select="udt:Data[count(. | key('data-by-group', udt:Group)[1]) = 1]">
     <xsl:sort select="udt:Group" order="ascending" />
        <xsl:choose>
          <xsl:when test="udt:Group='1'">
            <li style="padding: 0 0 15px 0;">
              <div style="font-size: 16px;">
                GENERAL DOCUMENTS:
              </div>
                  <xsl:apply-templates select="$currentData" mode="list">
                    <xsl:sort select="udt:Bid_x0020_Date_UDT_Value" order="ascending" />
                  </xsl:apply-templates>
            </li>
          </xsl:when>

          <xsl:when test="udt:Group='2'">
            <li style="padding: 0 0 15px 0;">
              <div style="font-size: 16px;">
                INSTRUCTIONS:
              </div>
                  <xsl:apply-templates select="$currentData" mode="list">
                    <xsl:sort select="udt:Bid_x0020_Date_UDT_Value" order="ascending" />
                  </xsl:apply-templates>
            </li>
          </xsl:when>
        </xsl:choose>
      </xsl:for-each>
    </ul>
  </xsl:template>

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForm and ListForm and ListUsing Calculated Column to add up hidden column valuesUsing Calculated Column to add up hidden column values


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out