Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

ACA Designing

Hi Team,

I'm working on the study with the 3 attributes -> product, price per Device, days used per month. These will be displayed in the ACA choice tasks.

I would like to know whether it would be possible to display a calculated price per month on each screen. This would not be an attribute but rather a helper row in the program.
For instance if price per Device (assuming 10 day Device) = INR 4,000 and days used per month = every day, price per month = INR 12,000.

For Example:
Brand A
Everyday
INR 4,000 per Device
INR 12,000 which will be calculated field and not attribute.

Let me know your thoughts.
asked Nov 13 by Milan Sanathra Bronze (530 points)
Not an answer to your key question...but a comment of why are you thinking to use ACA software for a 3-attribute problem?  Normally, one would use CBC software for this.  And, one could use CBC software's "conditional display" functionality to display additional information such as calculated price per month for each product concept.
Thank you Bryan,

We have recommend the same but client  would like to do ACA here. Just wanted to understand if it possible to add a calculated field in the design.

2 Answers

0 votes
I'm not aware of a way to add conditional display functionality to an ACA survey to make this happen.  But, people like Zachary Anderson at Sawtooth Software often come up with crazy tricks that can be done in CSS and Javascript to make such things happen with our software.  Maybe the wizard Zachary knows.
answered Nov 17 by Bryan Orme Platinum Sawtooth Software, Inc. (179,015 points)
0 votes
We'll want to start by adding some hidden HTML to our level texts.  Add this HTML to the price levels, with the value set to the current level's price:

<input type="hidden" class="price" value="1000"/>


And add this HTML to the use frequency levels, with the value set to the number of days used per month:

<input type="hidden" class="usage" value="30"/>


If you want this behavior in ACA Pairs, add this script to those questions:

<script>
$(document).ready(function(){
    $('#[% QuestionName() %]_div .level_text_div').each(function(){
        var price = Number($(this).find('.price').val());
        var usage = Number($(this).find('.usage').val());
        if (price && usage) {
            var pricePerMonth = price * usage / 10;
            var formattedPricePerMonth = 'INR ' + pricePerMonth.toLocaleString() + ' per month';
            $(this).append('<div class="level_text">' + formattedPricePerMonth + '</div>');
        }
    });
})
</script>


Or in ACA Calibration questions, use this:

<script>
$(document).ready(function(){
    var tbody = $('#[% QuestionName() %]_div .inner_table > tbody');
    var price = Number($(tbody).find('.price').val());
    var usage = Number($(tbody).find('.usage').val());
    if (price && usage) {
        var pricePerMonth = price * usage / 10;
        var formattedPricePerMonth = 'INR ' + pricePerMonth.toLocaleString() + ' per month';
        $(tbody).children(':last-child').before('<tr><td><div class="level_text">' + formattedPricePerMonth + '</div></td></tr>');
    }
})
</script>


How does that work for you?
answered Nov 17 by Zachary Platinum Sawtooth Software, Inc. (156,375 points)
Thank you so much Zachary.

Let me try it implement it.
...