Skip to main content
Announcements
Defect acknowledgement with Nprinting Engine May 2022 SR2, please READ HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
ElifGuler
Contributor II
Contributor II

Variable value does not work

Hello,

I have created dasboard in Qlik Sense. I created variables for my measures like example below. I want to use Nprinting based on user values, so I set an employee ID number value in variable  part of filter, then I added this filter for user but it does not work.  Any help will be really appreciated?

SET v_RESPONSIBLE = 'SEC_ACC_ADMA';
SET v_RESPONSIBLE_PS = 'SEC_ACC_PS';

SET v_OsUser = (upper(SubField(OSUser(),'=',-1);

Measure: count({<SEC_ACC_PS={$(v_OsUser)},TASK_ENTITY={"Proje Ziyareti"}>} [Task_Subject])

Nprinting :

 

ElifGuler_0-1663871814037.png

 

Thanks.

 

Labels (2)
7 Replies
RafaelBarrios
Partner - Specialist
Partner - Specialist

Hi @ElifGuler 

I’m not very sure where you are having the problem, if it’s  in nprinting or sense app, but you are missing some single quotes in the formula because you are evaluating text and not number

count({<SEC_ACC_PS={'$(v_OsUser)'},TASK_ENTITY={"Proje Ziyareti"}>} [Task_Subject])

Best,

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi, 

The logical error is that your variable does not have expression in it so you cannot use "EVALUATE"  checkbox. You just want variable v_OsUser to be set to HTR0410 therefore there is nothing to evaluate! Untick the "evaluate" box and try again.

I also agree that having single quotes is more elegant and should be applied in your set analysis.

I suggest studying how to use particular functions to be sure that correct methods are used - here is a link https://help.qlik.com/en-US/nprinting/May2022/Content/NPrinting/ReportsDevelopment/Static-dynamic-fi...

cheers

Lech

 

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

On completely different subject. Is there any reason why you had to do set analysis for user selection instead of just regular section access or filters?

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
ElifGuler
Contributor II
Contributor II
Author

Since some users are managers and they should see also their team employee's data , we could not apply section access or user filter. 

RafaelBarrios
Partner - Specialist
Partner - Specialist

That Section access souldnt be a problem if done propperly.

Using section access you can set the managers to see others user data, just add more lines for manager to link with other users data.

Best,

 

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Correct - just like @RafaelBarrios said - section access shouldn't be a problem if planned and done properly

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

ohh - same would apply for user filters - at the end you are using a filter anyway, right?

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.