Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Alternating Fields in Bar Chart

I have created bar chart.

As dimension I use [Authenticated User] field for the chart.

The thing is - this field displays only Usernames, and I want it to display full names.

That is why I made LEFT JOIN with the table and I have managed to get Full names for respective usernames.

Problem is - it can rarely happen that some usernames do not have corresponding Full names (these are some special usernames)

In that case I would like my chart legend to display username and not full name.

Is that possible and if yes, please how can I do it?

Thanks

D.

edit:

is it possible to create "Dynamic dimension" with something like following code:

 

if

[Authenticated user] <> ''
then Full_Name
else
[Authenticated user]

13 Replies
Peter_Cammaert
Partner - Champion III
Partner - Champion III

Yes, use a MAPPING LOAD

Peter

Not applicable
Author

hey Peter!
I considered this option.

However, I am not sure how can I in that case display, usernames that do NOT have corresponding First_NAME (Vorname) and Last_NAME (Nachname).

Is it possible to make an if statement in Sessions table that will consider this? If yes, can you please tell me how?

Peter_Cammaert
Partner - Champion III
Partner - Champion III

The script example with MAPPING LOAD creates a new field in Sessions called Full_Name that will contain either:

  • the concatenation of Vorname + Nachname if Vorname is Non-NULL, or
  • the value of [Authenticated user] if Vorname is empty or NULL.

This is all done by the call to applymap(). The mapping table will not have any entries for users with a missing Vorname. Therefore the lookup will fail and applymap() will resort to the value of the third parameter.

So in your chart, just use Full_Name and everything will be fine

Peter

Not applicable
Author

You are completely right!
It works!

Thanks for your support