Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

If field omitted, show another field

Have two fields

unencrypted_number - this is omitted for most users

encrypted_number - everyone can see this

For a dimension in a graph , I want to say "If unencrypted_number is omitted use encrypted_number, else use unencrypted_number"

Can this be achieved?

Many thanks,

Michael

1 Solution

Accepted Solutions
dgreenberg
Luminary Alumni
Luminary Alumni

This is not an elegant solution but could be the start for you.

Add secretField as an expression

then add another expression that says

if(len(column(1))>=1,secretField,publicField)

I am sure you could say if (lefn(secretField))>=1 as well.

Hope this gets you started.

Dan

View solution in original post

4 Replies
MarcoWedel

please post sample data/app

regards

Marco

Not applicable
Author

Attached is .qv.

data is inline. admin is admin...user 1 can't see secret field, user 2 can, so if user 1 is logged in, I want the diemsion of the graph to change from secretField to publicField

Thanks,

Code

Section Access;

LOAD * INLINE [

  ACCESS, USERID, PASSWORD,OMIT

  ADMIN,admin,admin,

  USER,user1,user1,secretField

  USER,user2,user2,

  ];

  Section Application;

myData:

LOAD * INLINE [

    secretField, publicField, sales

    1111, xxxx, 21

    2222, yyyy, 42

    3333, zzzz, 53

];

dgreenberg
Luminary Alumni
Luminary Alumni

This is not an elegant solution but could be the start for you.

Add secretField as an expression

then add another expression that says

if(len(column(1))>=1,secretField,publicField)

I am sure you could say if (lefn(secretField))>=1 as well.

Hope this gets you started.

Dan

Not applicable
Author

not the most elegant as you say but it works

tyvm