Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Announcements
Qlik Analytics Tour 2020 Online. Begins August 10th. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

List box to reduce "Week" field data on section access

Scenario I have is we have a recent calendar data loaded for 20 weeks. I have a multibox for weeks which shows a drop down list of all 20 weeks data. The reuirement is depending on the user access, admin role should be able to see all the 20 weeks data in the dropdown multibox and for regular user only recent most 13 weeks should be shown in the multibox field. It would be really helpful if you show me something with your example above to only show respective weeks depending on the useraccess role admin or user.

I was able to put the flag around the 'week' field saying that if (Week >13, 1, 0) as Week_Flag.

My 'Week' field has 20 weeks data now and depending on the section access, if its user then the 'Week' field need to reduce the data to show only recent 13 weeks. How should I do this or is there any alternative solution to this.

Please suggest if you have any samples to share that would be great too.

Thanks

DD

1 Solution

Accepted Solutions
Highlighted
Not applicable

Re: List box to reduce "Week" field data on section access

is this what you need? see attached example, which is basically this:

Section Access;

LOAD * INLINE [

    ACCESS, USERID, PASSWORD, VIEW

    ADMIN, ADMIN, ADMIN, *

    USER, USER, USER, 1

];

Section Application;

Calendar: Load *, if(Date >= Today()-(7*13),1,0) as VIEW;

Load Date(Today() - RecNo() +1) as Date AutoGenerate(365);

View solution in original post

7 Replies
Highlighted
Not applicable

Re: List box to reduce "Week" field data on section access

is this what you need? see attached example, which is basically this:

Section Access;

LOAD * INLINE [

    ACCESS, USERID, PASSWORD, VIEW

    ADMIN, ADMIN, ADMIN, *

    USER, USER, USER, 1

];

Section Application;

Calendar: Load *, if(Date >= Today()-(7*13),1,0) as VIEW;

Load Date(Today() - RecNo() +1) as Date AutoGenerate(365);

View solution in original post

Highlighted
Not applicable

Re: List box to reduce "Week" field data on section access

Thanks Juan!

It worked, as exactly what I was looking for thanks for all the help.

Just made these corrections:

Section Access;

LOAD * INLINE [

    ACCESS, USERID, PASSWORD, VIEW

    ADMIN, ADMIN, ADMIN, 1

    USER, USER, USER, 0

];

Section Application;

Thanks again,

DD

Highlighted
Not applicable

Re: List box to reduce "Week" field data on section access

actually the * in the section access is intentional, so ADMIN can view everything in the calendar table..

Highlighted
Not applicable

Re: List box to reduce "Week" field data on section access

Hi Juan,

The admin should be seeing all the data and user should only see the latest 13 weeks data, when logged in as a admin I only see 13 weeks data and not *.

Please suggest!

Thanks

DD

Highlighted
Not applicable

Re: List box to reduce "Week" field data on section access

it seems the star in the section access isn't working (even with 'star is *')...leaving the VIEW field blank for ADMIN works:

LOAD * INLINE [

    ACCESS, USERID, PASSWORD, VIEW

    USER, USER, USER, 1

    ADMIN, ADMIN, ADMIN,

];

Highlighted
Not applicable

Re: List box to reduce "Week" field data on section access

Thanks Juan!

This is exactly what I was looking for, appreciate all the help.

Thanks,

DD

Highlighted
Not applicable

Re: List box to reduce "Week" field data on section access

Hi Juan,

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.

OSUserRole
DDESAI\DIPTIDESAIUser

'SheetAccess' in the excel has the following data which works to hide/show the sheet access for certain roles:

RoleDashboardAnalysisGeoOutliersInsights
Admin11111
Analyst11110
Category Manager10110
Senior Mgt10110
Special User10011
User10110

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.

SECTION Application;

LOAD NTNAME as USERID,

     SECTIONKEY

Resident Sec;

Users:

LOAD Role,

     upper(OSUser) as OSUser    

FROM

UserSheetAccess.xls

(biff, embedded labels, table is UserRoles$);

Concatenate

Load 'User' as Role,

     NTNAME as OSUser

     Resident Sec;

    

Join

LOAD Role,

     Dashboard as SH01,

     Analysis as SH07,

     Geo as SH02,

     Outliers as SH10,

     Insights as SH11

FROM

UserSheetAccess.xls

(biff, embedded labels, table is SheetAccess$);

Please help, any suggestion or workaround is greatly appreciated.

Thanks,

DD