Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
SRT10
Contributor III
Contributor III

What is wrong with my If condition

Code -

Section Access;

USERS:
LOAD [ACCESS],
UPPER(TRIM(NTNAME)) as NTNAME,
IF(MARKETTYPE='Primary','Primary','Secondary') AS MARKETTYPE
REGIONS 
FROM QVD\ADMIN_ACCESS.qvd (qvd)
Where 1=1;

Section Application;

By default Secondary is getting selected even if we have primary as MARKETTYPE.

Why is this happening ?

Data in MARKETTYPE column looks like -

ACCESS NTNAME MARKETTYPE
USER 123 Primary
ADMIN 456 Secondary
USER 789 Secondary
ADMIN 111 Primary

 

If we are directly using MARKETTYPE column as -

Section Access;

USERS:
LOAD [ACCESS],
UPPER(TRIM(NTNAME)) as NTNAME,
MARKETTYPE
REGIONS 
FROM QVD\ADMIN_ACCESS.qvd (qvd)
Where 1=1;

Section Application;

Using above I am not able to open dashboard and it tells you don't have access to this document. 

If we are using If Condition then Secondary is directly getting selected after opening dashboard and its same across all users.

 

QlikView  

Experts advise - 

@robsommer @DW @marcus_sommer  @sunny_talwar  @rwunderlich @JonnyPoole 

5 Replies
marcus_sommer

Just comment the section access; to load the table visible within the data-model. Are there any synthetic keys or circular loops? If yes then change it appropriate - maybe at first by using only one field for reduction and then the other to check if they work on this level as expected and later you may combine both field into a single-field because it's usually the simplest way to get rid of the synthetic keys / circular loops.

If not then create a tablebox in which you put all relevant fields to see if belonging data from the formatting, data-quality and the association between them are loaded properly.

- Marcus 

SRT10
Contributor III
Contributor III
Author

Its working fine if we look at this data/logic outside of section access. It doesn't works when we place it with section access. what can be the issue here. Is it the data set which is causing this issue. Association also looks good 

marcus_sommer

There are two things which may be adjusted and/checked. First is to apply the values from MARKETTYPE (within the section access as well as in the normal data-model) in upper() and second is a check on the values which you have within NTNAME and how the users are identified within the app - this could be checked with a textbox() with osuser() as expression.

- Marcus

Scott9733
Contributor
Contributor


@SRT10 wrote:

Code -

Section Access;

USERS:
LOAD [ACCESS],
UPPER(TRIM(NTNAME)) as NTNAME,
IF(MARKETTYPE='Primary','Primary','Secondary') AS MARKETTYPE
REGIONS myindigocard
FROM QVD\ADMIN_ACCESS.qvd (qvd)
Where 1=1;

Section Application;

By default Secondary is getting selected even if we have primary as MARKETTYPE.

Why is this happening ?

Data in MARKETTYPE column looks like -

ACCESS NTNAME MARKETTYPE
USER 123 Primary
ADMIN 456 Secondary
USER 789 Secondary
ADMIN 111 Primary

 

If we are directly using MARKETTYPE column as -

Section Access;

USERS:
LOAD [ACCESS],
UPPER(TRIM(NTNAME)) as NTNAME,
MARKETTYPE
REGIONS 
FROM QVD\ADMIN_ACCESS.qvd (qvd)
Where 1=1;

Section Application;

Using above I am not able to open dashboard and it tells you don't have access to this document. 

If we are using If Condition then Secondary is directly getting selected after opening dashboard and its same across all users.

 

QlikView  

Experts advise - 

@robsommer @DW @marcus_sommer  @sunny_talwar  @rwunderlich @JonnyPoole 


It doesn't works when we place it with section access. what can be the issue here. Is it the data set which is causing this issue.

marcus_sommer

IMO very helpful is to start with a simple dummy-app. Just a few inline-records for the section access and the section application. It excludes all relations to your existing app and their data-model and data(-quality). If it worked like expected you may step by step switch a bit more in the direction of your real scenario.

A lot of information could you also find here:

Section Access - Qlik Community - 1493681

- Marcus