Relevance equation - Date higher than X & Question Answer is Y

Plus d'informations
il y a 1 an 6 mois #164554 par rbernhardthki
In another topic I got help so that I can show a question of the installation date is within 60 days. Problem is I have another criteria for this question, if Manufacturer is Y then it is only 30 days instead of 60 like everyone else.

When I add the Relevance equation it works fine, but the issue is that if the date is within 30 days, it displays both questions. When I add a condition manually to say Question X's answer has to equal to Y. It will overwrite my below date check. Is it possible to add an IF to the below so that it works? Or how can I do it?

60 Days
(strtotime(date('Y-m-d'))-strtotime(INSERTANS:669123X301X2381)) >= (60*60*24*60)

30 Days
(strtotime(date('Y-m-d'))-strtotime(INSERTANS:669123X301X2381)) >= (60*60*24*30)

Thanks

Connexion ou Créer un compte pour participer à la conversation.

LimeSurvey Partners
Plus d'informations
il y a 1 an 6 mois #164561 par tpartner
Assign the 30/60 number in another equation question (lets call it "warrantyPeriod") and the reference that in your relevance equation.

(strtotime(date('Y-m-d'))-strtotime(INSERTANS:669123X301X2381)) >= (60*60*24*warrantyPeriod)

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 an 6 mois #164572 par rbernhardthki
Not sure im following.

I have a question called warranty type with 3 answer options. Commissioning, Parts only, Parts Labour & Travel.

There is another question with different Manufacturers listed.

If Commissioning and X OEM is selected I need 30 days, all others are 60 days.

How do I make a new question so that I can reference the 30/60 as you mentioned?

Thanks

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 an 6 mois #164579 par tpartner
It's impossible for me to give an equation code example without knowing your survey set-up and question/answer codes but here is a sample survey that should give you the idea.

Selecting the first option in Q1 and Q2 will result in a warranty period of 30 days, all other combination of selections result in 60 days.

Fichier attaché :

Nom du fichier : limesurvey...6928.lss
Taille du ficher :16 ko

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com
Pièces jointes :

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 an 6 mois #164580 par Joffm

If Commissioning and X OEM is selected I need 30 days, all others are 60 days.


Read about the if-statement in the manual.

Then you create an equation (lets call it "warrantyPeriod") like

{if (manufacturer=="X OEM",30,60)}

Afterwards you can use this variable.

Regards
Joffm


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

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 an 6 mois #164582 par rbernhardthki
The survey is somewhat more complicated than that. If you could have a look at the attached, that is basically what I need working.

Q1 = warranty type

Q2 = OEM (although on the real survey this is 3 separate question, one for each warranty type)


Then I have 4 text display options, depending on what was selected as the text needs to be different for each.

Now the issue is I have is that it displays the other 3 text displays no matter what date option is selected. The corresponding text display is hidden is the date is within the 60 days.

Any idea what I am doing incorrectly?

Fichier attaché :

Nom du fichier : limesurvey...9282.lss
Taille du ficher :25 ko
Pièces jointes :

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 an 6 mois - il y a 1 an 6 mois #164584 par Joffm
Hi,
set the relevance of Q3, Q4,... not only to "equationX" but to "equationX!=0" (or "equationX==1").

Joffm


Volunteers are not paid.
Not because they are worthless, but because they are priceless
Dernière édition: il y a 1 an 6 mois par Joffm.

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 an 6 mois #164588 par rbernhardthki
Great stuff! Works great.

One more thing, now I have a question group that is empty if the date is correct. Is it possible to skip/hide question groups where all answers are hidden?

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 an 6 mois - il y a 1 an 6 mois #164595 par Joffm
Just set the relevance of the group.
Should be something like:
(equation1==1) or (equation2==1) or ...

Joffm


Volunteers are not paid.
Not because they are worthless, but because they are priceless
Dernière édition: il y a 1 an 6 mois par Joffm.

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 an 6 mois #164598 par rbernhardthki
Cheers mate, you guys are the best

Connexion ou Créer un compte pour participer à la conversation.

Commencez dès maintenant !

Créez simplement un compte et commencez à utiliser LimeSurvey dès aujourd'hui.

Inscrivez-vous maintenant

Inscrivez-vous à notre Newsletter!