Search the Community
Showing results for tags 'case'.
Found 2 results
Hi, I have a Details Datapage where i would like to use a SELECT statements to pull data another table into a Virtual Calculated Field. It goes well so far as pulling the count across all Company_ID's, but when I add RLS to the statement values turn 0 even though the formula is verified. - Both, Booking_Status & Assign_To are in the table Bookings - Assign_To is a text field (255) that match the [@authfield:Company_Users_tbl_Company_ID] I have tried various combinations and expression like: 1. SELECT COUNT(DISTINCT Booking_Status) AS Pending FROM Bookings WHERE Assign_To = '[@authfield:Company_Users_tbl_Company_ID]' 2. SELECT COUNT(Booking_Status) from Bookings WHERE Booking_Status='Pending' AND Assign_To = '[@authfield:Company_Users_tbl_Company_ID]' Though, the formulas are both verified but not working as they return 0, i think perhaps that the table field Assign_To needs to have a FROM Bookings reference, this i have tried as well without luck. I would appreciate very much if anyone have suggestions to a correct statements. Sincerely Ras
It is possible to set checkmark condition using Calculated Value. The field should be set as Calculated Value The basic formula to set the condition is: CASE WHEN [@field:IntegerValue]=100 THEN 'X' ELSE 'Y' END For Yes/No field, the boolean value us 1/0. However, to make it work properly, the field should receive BIT value. So, CAST function should be applied: CASE WHEN [@field:IntegerValue]=100 THEN CAST(1 as bit) ELSE CAST(0 as bit) END