Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Qlikuser225
Contributor III
Contributor III

Help with possible function

Hello,

Can anyone please help me with below?

I have a data set 

User      Year    Flag

AAA        2025     -

AAA       2024     Y

AAA        2023    Y

On the SHEET i have a condition to show only if Flag='Y' .

But that SHEET should also appear to user AAA when Year 2025 is selected where Flag is null (because he had Flag = 'Y' in prior years - sheet should show regardless of selected Year if he ever had Flag Y)

Can anyone please help with the condition to use on the sheet for above scenario?

Thanks in Advance

Labels (3)
1 Solution

Accepted Solutions
AgatheClero
Partner - Contributor II
Partner - Contributor II

Hi @Qlikuser225 ,

The cleanest solution is to create a new flag in your script. This new flag will take the value "1" if the user has a row where Flag = Y, regardless of the year, otherwise "0".

To do it, you can create a mapping table like this : 

AgatheClero_0-1745417369332.png

And you will have the following result :

AgatheClero_1-1745417485089.png

Then, you just need to write this in your set analysis : {< Flag_Y = {1} >}

 

 

View solution in original post

2 Replies
JandreKillianRIC
Partner Ambassador
Partner Ambassador

Hi @Qlikuser225 

 

Try this 

IF(
(OSUser() = 'UserDirectory=Dir; UserId=jandre.killian' and GetFieldSelections(Year) = '2025') or (GetFieldSelections(Flag) = 'Y')
, 1
, 0)

 

Just checking, You can use the OSUser() to get the current user, Is the User is just a field on your side you can just change the expression to 

 

IF(
(User = 'AAA' and GetFieldSelections(Year) = '2025') or (GetFieldSelections(Flag) = 'Y')
, 1
, 0)

 

You might need to add the Isnull(Flag) is you have more data where the Flag field is null. 

 

Regards

 

Mark the solution as accepted that solved your problem and if you found it useful, press the like button! Check out my YouTube Channel | Follow me on LinkedIn

AgatheClero
Partner - Contributor II
Partner - Contributor II

Hi @Qlikuser225 ,

The cleanest solution is to create a new flag in your script. This new flag will take the value "1" if the user has a row where Flag = Y, regardless of the year, otherwise "0".

To do it, you can create a mapping table like this : 

AgatheClero_0-1745417369332.png

And you will have the following result :

AgatheClero_1-1745417485089.png

Then, you just need to write this in your set analysis : {< Flag_Y = {1} >}