Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
gabyala79
Contributor II
Contributor II

Vlookup from a variable into a table

Hi everyone!!

I would like to share you one case I'm struggling a lot to find some solution. Let me explain:

I have a Dashboard to follow performance of several org areas (and subareas) through the different months. All the KPIs work fine, and now I want to add one 'text box' with some comments related to the combination of:

      Area X ; Date Y

So, I already managed to create an easy variable making the text for line above, and it is linked to the current selections in the app. In my example: "A ; 01/02/22".

Then, I loaded the table below in the app, and now the problem is that I do not know how to retrieve the comment with the entry of this variable.

Can someone guide me with some solution?

Thanks a lot!!

gabyala79_0-1644335692488.png

 

 

5 Replies
marcus_sommer

Why not a simple expression within the text-box with something like:

maxstring(Comments)

Depending on your real scenario you may also change the aggregation-function or add some set analysis or ...

- Marcus 

gabyala79
Contributor II
Contributor II
Author

Thanks Marcus_sommer for your reply!!

Anyway, I do not understand how I can link the variable I already created to do 'Area X ; Date Y' to retrieve the correct row from the table.

Can you please help me on this?

Thanks

marcus_sommer

Ideally your comment-data are fully linked within the data-model and then you could use the mentioned approach. If they are not directly linked maybe because it's a loosen table you need nevertheless comparable data-structures. Means also a date- and an area-field. With it you could reference to your wanted data. It may look like:

only({< DateComment = p(DateFact ), AreaComment = p(AreaFact) >} Comment)

- Marcus

gabyala79
Contributor II
Contributor II
Author

Thanks again!

It is like you said, I have a table isolated from rest of the model, and I tried to get the comment doing:

maxstring(only({<IdComments = '3'>}[General Comments]))

just to test the syntaxis, but the following error appears:

"Nested aggregation not allowed

Am I doing something wrongly?

Thanks

marcus_sommer

Yes, it's not quite right. Aggregations couldn't be nested unless you wrap them with an aggr() to create an appropriate dimensionality for the (inner) aggregation. I don't think that you need it here. Just try it with:

maxstring({<IdComments = {'3'}>}[General Comments])

- Marcus