Forum Discussion
If and or statements (simple)
- 5 years ago
Hi Anonymous
You need to place the most restrictive conditions first. Otherwise, if Wage Fixed is greater than both 50 and 10000, the first condition will be met ("Monthly") and the code won't check for the "Annual" condition
if [#"Wage: Range - Ceiling"] > 10000 or [#"Wage: Fixed"] > 10000 or [#"Wage: Up Until"] > 10000 or [#"Wage: Starting From"] > 10000 then "Annual" else if [#"Wage: Range - Ceiling"] > 50 or [#"Wage: Fixed"] > 50 or [#"Wage: Up Until"] > 50 or [#"Wage: Starting From"] > 50 then "Monthly" else "Hourly"Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
Hi Anonymous
You need to place the most restrictive conditions first. Otherwise, if Wage Fixed is greater than both 50 and 10000, the first condition will be met ("Monthly") and the code won't check for the "Annual" condition
if [#"Wage: Range - Ceiling"] > 10000 or [#"Wage: Fixed"] > 10000 or [#"Wage: Up Until"] > 10000 or [#"Wage: Starting From"] > 10000 then "Annual" else if
[#"Wage: Range - Ceiling"] > 50 or [#"Wage: Fixed"] > 50 or [#"Wage: Up Until"] > 50 or [#"Wage: Starting From"] > 50 then "Monthly"
else "Hourly"
Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers