- Posts: 12940
- Thank you received: 3979
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
- Topic Author
- Offline
- LimeSurvey Community Team
Less
More
1 month 1 week ago #258686
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Can you apply filter on both Subquestions & Answer options in Array type quex was created 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
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
- Topic Author
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12940
- Thank you received: 3979
1 month 1 week ago #258693
by Joffm
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
Replied by Joffm on topic Can you apply filter on both Subquestions & Answer options in Array type quex
What?this also for single choice for multiple choice what can you do for the same
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
- Topic Author
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12940
- Thank you received: 3979
1 month 1 week ago #258702
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Can you apply filter on both Subquestions & Answer options in Array type quex
It is
You saw the screenshot.
Did you add the compatibilty in "config.xml" of the plugin?
Show, what exactly you entered.
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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13648
- Thank you received: 2491
1 month 1 week ago #258708
by DenisChenu
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.
Replied by DenisChenu on topic Can you apply filter on both Subquestions & Answer options in Array type quex
Can you create an issue or a Pull Request please ?[url] gitlab.com/SondagesPro/QuestionSettingsType/hideEmptyColumn [/url]
In the "config.xml" you have to add the compatibility for version 6.0.
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
- Topic Author
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12940
- Thank you received: 3979
1 month 1 week ago #258717
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Can you apply filter on both Subquestions & Answer options in Array type quex
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
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
- Topic Author
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12940
- Thank you received: 3979
1 month 1 week ago #258718
by Joffm
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
Replied by Joffm on topic Can you apply filter on both Subquestions & Answer options in Array type quex
To be honest:Can you create an issue or a Pull Request please ?
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
- Topic Author
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12940
- Thank you received: 3979
1 month 1 week ago #258720
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Can you apply filter on both Subquestions & Answer options in Array type quex
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
css:
Version 6.4.3. Theme: fruity-twentythree
Joffm
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&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 && countNotEmpty && $(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
- Topic Author
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12940
- Thank you received: 3979
1 month 1 week ago #258724
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Can you apply filter on both Subquestions & Answer options in Array type quex
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.
- rajkumar_dms
- Offline
- Senior Member
Less
More
- Posts: 42
- Thank you received: 0
1 week 17 hours ago #260592
by rajkumar_dms
Replied by rajkumar_dms on topic Can you apply filter on both Subquestions & Answer options in Array type quex
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
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
Attachments:
Please Log in to join the conversation.
- Joffm
- Topic Author
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12940
- Thank you received: 3979
6 days 17 hours ago - 6 days 17 hours ago #260769
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Can you apply filter on both Subquestions & Answer options in Array type quex
Make sure you have the correct synax.
The editor often changes operator signs to HTML entities, like >, <, &, 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.
The editor often changes operator signs to HTML entities, like >, <, &, 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.
- rajkumar_dms
- Offline
- Senior Member
Less
More
- Posts: 42
- Thank you received: 0
6 days 12 hours ago - 23 hours 10 minutes ago #260828
by rajkumar_dms
Replied by rajkumar_dms on topic Can you apply filter on both Subquestions & Answer options in Array type quex
Thanks @ joffm
It's working perfectly
It's working perfectly
Last edit: 23 hours 10 minutes ago by rajkumar_dms.
Please Log in to join the conversation.