Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Query for a list of persons in a Chart

I have a Diagram in which in one of the formel, I need to show the names of the workers in the company...

I have a code like this


= if ( isnull(P_LASTNAME)
,
'-'
,
if (len(P_LASTNAME & ', ' & P_FIRSTNAME)<25
,
P_LASTNAME & ', ' & P_FIRSTNAME & chr(10) & chr(10) & P_TARIFGRUPPE
,
P_LASTNAME & ', ' & FIRSTNAME & chr(10) & P_TARIFGRUPPE
)
)
[/Code]

The above code was for one person but now I have a Problem that there is a list of such names and I have to show all the Workers in this Query.
Any Ideas???</body>
7 Replies
Not applicable
Author

I'd run that code in the load script so as not to affect the perfomance of your charts.

Not applicable
Author

@dragonuata

Do u mean to write the code in the Load script as a Flag and use it.. But my question is how can I get a list of persons in Display and what changes I have to do in the script?

Thanks for the reply..

Not applicable
Author

Can you post an example of your raw data?

Not applicable
Author

Can anyone help me on this...

I think I did not express correctly. I will try to explain once more.

I use the above code in an expression of a chart to display the name.

As in the code given I assume there that only one name is present and according to that if there is no name I get a "-"

If there is a name and the length of the letters is less than 25 which is the maximum row length in the Chart then write it in oneline and then with a line gap write the tarifgruppe

Now the question is..

How can I change the above code if there are many names. If I have two or more names in my output i get a "-" in the display of chart.. I wonder why I get "-". As in code only when it is Null it must give a "-" not when there are more names..

Thanks in advance..

Not applicable
Author

Sorry, if i didn't understand your problem correctly. You are displaying Employee Name as an Expression, right? In expressions, if multiple value exists, we have to use aggregation functions like sum(), Min(), Max() to get the proper output. Otherwise, there should exist only one value for that expression. In your case, you can create a pivot table with

Dimensions : Company, EmployeeID

Expression: Employee Name

Not applicable
Author

@ richy

Thanks for the suggestion but how can I write a aggregation function in my case to display multiple values if they exist. If there is only one value my code which is given above works.. Can you pls suggest a code which gives multiple values from the above given code.. Thanks in advance...

Not applicable
Author

yup, that's why you can go for two dimensions and one expression like suggested earlier. That way, you will be able to list out the whole values.