best way to return number of hours
Collapse
X
-
yberges,
Thank you for additional information.
The following formula will work if:- Fields for days have the same option settings (meaning that each field has the same Non and Oui options);
- The field for the Wednesday is (presumably) named inscMercrediEnum, otherwise, just replace this field in formula with the name of your field.
Code:ifThen( inscMardiEnum = 'Non' && inscMercrediEnum = 'Non' && inscrJeudiEnum = 'Non', nombreDheureDeFormation = '0h' ); ifThen( inscMardiEnum = 'Non' && inscMercrediEnum = 'Non' && inscrJeudiEnum = 'Oui', nombreDheureDeFormation = '7h' ); ifThen( inscMardiEnum = 'Non' && inscMercrediEnum = 'Oui' && inscrJeudiEnum = 'Non', nombreDheureDeFormation = '7h' ); ifThen( inscMardiEnum = 'Oui' && inscMercrediEnum = 'Non' && inscrJeudiEnum = 'Non', nombreDheureDeFormation = '7h' ); ifThen( inscMardiEnum = 'Oui' && inscMercrediEnum = 'Oui' && inscrJeudiEnum = 'Non', nombreDheureDeFormation = '14h' ); ifThen( inscMardiEnum = 'Oui' && inscMercrediEnum = 'Non' && inscrJeudiEnum = 'Oui', nombreDheureDeFormation = '14h' ); ifThen( inscMardiEnum = 'Non' && inscMercrediEnum = 'Oui' && inscrJeudiEnum = 'Oui', nombreDheureDeFormation = '14h' ); ifThen( inscMardiEnum = 'Oui' && inscMercrediEnum = 'Oui' && inscrJeudiEnum = 'Oui', nombreDheureDeFormation = '21h' );
Leave a comment:
-
hello
a question because all return 0h
Code:ifThen( array\includes(inscMardiEnum, 'day1'), nombreDheureDeFormation = '7h' );
if inscMardiEnum have value 'day1' nombreDheureDeFormation is equal to 7h
or
inscMardiEnum have a value ?
inscMardiEnum is a dropdown with Yes or No value
regardsLeave a comment:
-
Hi yberges,
At the moment, I see one solution as follows: create a field of the Varchar type (for example, sumOfHours) and in the entity formula, add the following lines:
Code:ifThen( array\includes(days, 'day1'), sumOfHours = '7h' ); ifThen( array\includes(days, 'day2'), sumOfHours = '14h' ); ifThen( array\includes(days, 'day3'), sumOfHours = '21h' ); ifThen( array\includes(days, 'day1') && array\includes(days, 'day2'), sumOfHours = '21h' ); ifThen( array\includes(days, 'day1') && array\includes(days, 'day3'), sumOfHours = '28h' ); ifThen( array\includes(days, 'day2') && array\includes(days, 'day3'), sumOfHours = '35h' ); ifThen( array\includes(days, 'day1') && array\includes(days, 'day2') && array\includes(days, 'day3'), sumOfHours = '42h' ); ifThen( array\length(days) == 0, sumOfHours = '0h' );
If you have any difficulties or problems with this solution, or if you need to explain something, I will be happy to help you.Leave a comment:
-
best way to return number of hours
hello i try to create a pdf with an hour information
1 i have 3 fields to day participation in my entity (day1, day2, day3)
2 user can subscribe each day
3 in my pdf template i need to display a sum of hours regarding days selected (1 day = 7h, 2 days = 14h, 3 days = 21h)
thanks for helpingTags: None
Leave a comment: