is this what you need? see attached example, which is basically this:
LOAD * INLINE [
ACCESS, USERID, PASSWORD, VIEW
ADMIN, ADMIN, ADMIN, *
USER, USER, USER, 1
Calendar: Load *, if(Date >= Today()-(7*13),1,0) as VIEW;
Load Date(Today() - RecNo() +1) as Date AutoGenerate(365);
delete.qvw 135.0 K
Thanks for the solution but for some reason our section acces is complicated and its not working.
The section access is in the excel sheet as UserRoles sheet: which can be changed to admin/user/analyst for testing the other sheet access and it works.
OSUser Role DDESAI\DIPTIDESAI User
'SheetAccess' in the excel has the following data which works to hide/show the sheet access for certain roles:
Role Dashboard Analysis Geo Outliers Insights Admin 1 1 1 1 1 Analyst 1 1 1 1 0 Category Manager 1 0 1 1 0 Senior Mgt 1 0 1 1 0 Special User 1 0 0 1 1 User 1 0 1 1 0
The code for the Week field which needs to be 13/20 per user/admin role. Was successful to implement what you had mentioned in the calendar as:
date(WeekEnd(calendar_date),'MM/DD/YYYY') as Week,
if(calendar_date > Today()-(7*13),1,0) as Week_View
So when select the Week_View as 1 get only 13 weeks, when clear the selction get all the weeks its working like a charm.
The script for the section access and join to excel sheet using the roles is working fine, and I wasn't able to implement the section access part of you code, tweaking that I need help with since we have complicated section access code one is call to the database and one is the join to the above excel sheet code, how can we make it to work using Role and OSUser to make the weeks toggle between 13 for User and 20 for Admin.
LOAD NTNAME as USERID,
upper(OSUser) as OSUser
(biff, embedded labels, table is UserRoles$);
Load 'User' as Role,
NTNAME as OSUser
Dashboard as SH01,
Analysis as SH07,
Geo as SH02,
Outliers as SH10,
Insights as SH11
(biff, embedded labels, table is SheetAccess$);
Please help, any suggestion or workaround is greatly appreciated.