Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Need guidance in writing Script in QVW (source is QVD) similar like Case Statement in SQL. Please below Query

Hi All,

Need guidance in writing Script in QVW (Where source is QVD) similar like Case Statement in SQL. Please below Query and modify below case statement.

Section Access;  /* Start section access script */

LOAD

CASE WHEN [EMP NAME] IN ('SHIVENDOO KUMAR','RAM KUMAR')THEN 'ADMIN' ELSE 'USER' END AS ACCESS,

[EMP NAME] AS USERID,

[EMP NAME] AS PASSWORD,

EMP_KEY AS _EMP_KEY

FROM DIM_EMP_DATA.QVD (qvd);

Section Application; /* End section access script */

Another question I have in mind, in Above Section Query I have defined [EMP NAME] as USERID & PASSWORD. So If User Name is with White space like SHIVENDOO KUMAR , in this case will it work or not?

1 Solution

Accepted Solutions
iktrayanov
Contributor III

Re: Need guidance in writing Script in QVW (source is QVD) similar like Case Statement in SQL. Please below Query

try

If(match([EMP NAME],'SHIVENDOO KUMAR','RAM KUMAR'),'ADMIN','USER')


1 Reply
iktrayanov
Contributor III

Re: Need guidance in writing Script in QVW (source is QVD) similar like Case Statement in SQL. Please below Query

try

If(match([EMP NAME],'SHIVENDOO KUMAR','RAM KUMAR'),'ADMIN','USER')


Community Browser