Not show empty tables

Hello, I want to hide all the users where the tables are empty.
I tried to put where the red arrow is ::{0}:,}

I checked also this post because I thought the problem were the same, but I seem to turn around and can’t find a solution.

Thanks for any help

It’s hard to say without knowing what your calling in the script.
Looks like your gathering all data within the script so if that’s the case you would need to drop the irrelevent data within that.

It would be good if you better explained your situation.
Looks like your working on some form of time clock?

Show your script so everyone can understand what is happening as from what you posted all we know is your calling a script and rendering the response…

The users() function only calls a list of all users from sambapos.

function users(){
var query = “SELECT [Name] FROM [MB].[dbo].[Users]”;
var result = sql.Query(query).Join(’|’);
return result;
}

Then there is User:X which checks for every user if there is data in the Program setting column.

declare @Test varchar(20) = [at]1
SELECT SUBSTRING([Value], 0, CHARINDEX(’;’, [VALUE]) ) as Name
,SUBSTRING([Value], CHARINDEX(’;’, [VALUE])+1, 10 ) as DateBegin
,SUBSTRING([Value], CHARINDEX(’;’, [VALUE])+11, 6 ) as TimeBegin
,SUBSTRING([Value], CHARINDEX(’;’, [VALUE])+25, 10 ) as DateEnd
,SUBSTRING([Value], CHARINDEX(’;’, [VALUE])+35, 6 ) as TimeEnd
,CASE WHEN SUBSTRING([Value], CHARINDEX(’;’, [VALUE])+25, 10 ) = ‘’ THEN NULL ELSE CONVERT(varchar(10),DATEDIFF(minute,CONVERT(DATETIME,SUBSTRING([Value], CHARINDEX(’;’, [VALUE])+1, 10 )+SUBSTRING([Value], CHARINDEX(’;’, [VALUE])+11, 13 ),105),CONVERT(DATETIME,SUBSTRING([Value], CHARINDEX(’;’, [VALUE])+25, 10 )+SUBSTRING([Value], CHARINDEX(’;’, [VALUE])+35, 13 ),105))/60)+‘H’+ CONVERT(varchar(10),DATEDIFF(minute,CONVERT(DATETIME,SUBSTRING([Value], CHARINDEX(’;’, [VALUE])+1, 10 )+SUBSTRING([Value], CHARINDEX(’;’, [VALUE])+11, 13 ),105),CONVERT(DATETIME,SUBSTRING([Value], CHARINDEX(’;’, [VALUE])+25, 10 )+SUBSTRING([Value], CHARINDEX(’;’, [VALUE])+35, 13 ),105)) % 60)+‘min’ END AS ‘Temps’
FROM [MB].[dbo].[ProgramSettingValues]
Where SUBSTRING([Value], 0, CHARINDEX(’;’, [VALUE]) ) = @Test

I think this is quite messy and could be made nicer with functions and variables…

Here is the example of one record:

Administrator;04-11-2019 08:52:42.020;04-11-2019 08:54:20.405

Either use tasks or even better would be Jesse’s 7shifts intergration.
Program settings is not the place to store mass info like that…
Also you will have report expressions for tasks which will be cleaner and easier than breaking apart all those values.

Thanks I am now trying to make it with Tasks. This seems amazing and is much easier :stuck_out_tongue: Thanks!

Is there a list with constraints to be used with {REPORT TASK DETAILS:X} ?

I found this but there is no clue about Tasks… probably at the time it was not yet implemented…

Thats a v4 topic, are you using v4?
There was allot of dev for tasks around the implementation time of v5.

See here for some ideas.

But not Jesse has retired this method in favour of the 7shifts intergration which offers allot of advantages. So be sure to check that out before spending too much time just looking at tasks to find you might actually prefer the 7shifts method.
I think his topic on that is in the beta section so you may not be able to see it.
For more info contact @Jesse for more details.

Thanks. The aim of what I am doing is to have a very basic time tracking which is universal in the idea that there is no need to create entities for each user and so…

OK, well tasks should do the job, shouldnt need entities for the tasks side, depends what else your doing with it.