Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
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
Creator III
Creator III

try

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


View solution in original post

1 Reply
iktrayanov
Creator III
Creator III

try

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