Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Can you apply filter on both Subquestions & Answer options in Array type quex

  • Joffm
  • Joffm's Avatar Topic Author
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 month 1 week ago #258686 by Joffm
Not with an array by column.
Array by column does not support array filter, does nmot support subquestion relevance.

But seeing your example you can swap the array to get a "normal" array.

For the y-axis you can either use subquestion relevance equation or array filter.
And for the x-axis you may use the plugin "hideEmptyCoplumn".
[url] gitlab.com/SondagesPro/QuestionSettingsType/hideEmptyColumn [/url]

In the "config.xml" you have to add the compatibility for version 6.0.

To create "EmptyColumns" you use an If-function, like
{if(Q1b_1=="Y","Azur","")}
If this subquestions was selected in Q1b, the answer option text is "Azur", otherwise is empty.





Joffm
 

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar Topic Author
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 month 1 week ago #258693 by Joffm

this also for single choice for multiple choice what can you do for the same

What?
No matter if single or multiple.
y-axis: you use subquestion relevance
x-axis: the plugin.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar Topic Author
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 month 1 week ago #258702 by Joffm
It is 
You saw the screenshot.

Did you add the compatibilty in "config.xml" of the plugin?
Show, what exactly you entered.

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 month 1 week ago #258708 by DenisChenu

[url] gitlab.com/SondagesPro/QuestionSettingsType/hideEmptyColumn [/url]

In the "config.xml" you have to add the compatibility for version 6.0.

 
Can you create an issue or a Pull Request please ?
 

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar Topic Author
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 month 1 week ago #258717 by Joffm
Sorry, I missed that you use the cloud version.
Here you can't install plugins (except for a small fee in Business and Corporate edition)

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar Topic Author
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 month 1 week ago #258718 by Joffm

Can you create an issue or a Pull Request please ?

To be honest:
I do not know what a Pull Request is.

I usually do it the pragmatic way.
I add the compatibility here.
 
If it works, fine, if not, bad luck.

Joffm


 

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar Topic Author
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 month 1 week ago #258720 by Joffm
And if you don't have rights to install the plugin
it is sufficient to insert the javascript snippet and the css snippet into your question text.
Like this
Code:
<script type="text/javascript" >
 
/*
 * JavaScript functions to hide empty answers colum in LimeSurvey
 * This allow using Expression Manager to hide answers in array question type
 *
 * @author Denis Chenu <denis@sondages.pro>
 * @copyright 2013-2015 Denis Chenu <http://sondages.pro>
 * @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&amp;dn=gpl-3.0.txt GPL-v3-or-Later
 * @version 2.0
 *
 */
$(document).on('ready pjax:scriptcomplete',function(){
  $("table.ls-answers").each(function(){
      var basetable=$(this);
      var fixedtable = $(this).hasClass('table-fixed') || $(this).hasClass('table-responsive');
      var countEmpty = 0;
      var countNotEmpty = 0;
          $(this).find("thead tr th").each(function(){
              var colindex = $(this).parent('tr').find('td,th').index($(this));
              if (colindex > 0) {
                  if($.trim($(this).html())==""){
                      basetable.find('col').eq(colindex).css('width',0);
                      basetable.find('col').eq(colindex).width(0);
                      basetable.find('tr').each(function(){
                          if(fixedtable) {
                              $(this).find('td,th').eq(colindex).addClass('hideEmptyColumn-hiddencolumn').children().hide();
                          } else {
                              $(this).find('td,th').eq(colindex).addClass('hideEmptyColumn-hiddencolumn').addClass('hidden-xs').children().hide();
                          }
                      });
                      basetable.addClass('hideEmptyColumn-widthhiddencolumn');
                      countEmpty++;
                  } else {
                      basetable.find('col').eq(colindex).addClass('havewidth');
                      countNotEmpty++;
                  }
              }
          });
          if(countEmpty &amp;&amp; countNotEmpty &amp;&amp; $(this).find('col.col-answers')) {
              var colanswersWidth = $(this).find('col').attr("style").replace("width:","").replace("%","").replace(";","").trim();
              if(!isNaN(colanswersWidth)) {
                  finalWidth = (100 - colanswersWidth)/countNotEmpty;
                  $(this).find('col.havewidth').css("width",finalWidth+"%");
              }
          }
  });
});
</script>

css:
Code:
<style type="text/css">td.hideEmptyColumn-hiddencolumn,th.hideEmptyColumn-hiddencolumn{
    overflow:hidden !important;
    border-spacing:0 !important;
    padding:0 !important;
    width: 0 !important;
    height: 0 !important;
    min-width: 0 !important;
}
td.hideEmptyColumn-hiddencolumn *,th.hideEmptyColumn-hiddencolumn * {
    display:none;
}
</style>


Version 6.4.3. Theme: fruity-twentythree




Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar Topic Author
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 month 1 week ago #258724 by Joffm
I do not see anything attached

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

More
1 week 17 hours ago #260592 by rajkumar_dms
Hi,

We had tried the above script to hide empty column but it seems not working either may i have doing some wrong
Also attached the lss file for the same

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar Topic Author
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 days 17 hours ago - 6 days 17 hours ago #260769 by Joffm
Make sure you have the correct synax.
The editor often changes operator signs to HTML entities, like &gt;, &lt;, &amp;, etc

And of course it has to be on a different page.
How else should it work if the script runs "$(document).on('ready pjax:scriptcomplete')?
Meaning it runs when the page is loaded, before you enter anything.
 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 6 days 17 hours ago by Joffm.

Please Log in to join the conversation.

More
6 days 12 hours ago - 23 hours 10 minutes ago #260828 by rajkumar_dms
Thanks @ joffm
It's working perfectly 
Last edit: 23 hours 10 minutes ago by rajkumar_dms.

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose