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: 
Anonymous
Not applicable

Input Box Expressions

Hello Qlik Community, I'm new to Qlikview and I am struggling with a task I must do.

I load some variables from my sql server; Region, Site and Tank. Each Tank has a region and a site and I want to create an input list where the user chooses the region the site and the tank. The tricky part is that when the user chooses a region, the list of sites must be filtered with the sites only coming from the specific region, same with the tank. When the user chooses the prefered site, only the tanks of the site must be displayed.

At the moment the variables containing the Region, Site and Tank are vRegion, vSite and vTank used in my Input Box and the expression used in all of them look something like this

" =Concat(DISTINCT Region,',') ".

Also the options Predefined Values Only and Predefined Values in Drop-down are used as well.

The part of my script where I load the variables is:

LOAD *;

select SiteGroup.Designation Region,Site.Designation Site, Tank.Designation Tank

from SiteGroup

join Site on Site.SiteGroupID=SiteGroup.SiteGroupID

join Tank on Tank.SiteID=Site.SiteID

I've been looking yesterday all day long for something that could help me but didn't had much luck. Any ideas will be much appreciated!

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Thank you for all your repies.I have managed to solve my issue using the Only() function while aggregating the entities of Region and Site from my datafield:

"=concat(DISTINCT aggr(only({<Region={$(vRegion)}>} Site),Site),',')".

The problem that I am facing right now is the following. When filtering the Tanks

"=concat(DISTINCT aggr(Only({<Site={$(vSite)}>} Tank),Tank),',')"

when the Site contains a whitespace character something isn't working right inside the expression and it returns a null string. Do you have possible solutions in mind? PS: I can change the whitespaces with an other special character like underscore when I load the data from the query but this isn't the right solution at the moment. I can contact with the people using the program that connects with the database to make sure they never use an underscore on a Site name but that's a last resort solution. Any ideas will be greatly appreciated!

View solution in original post

4 Replies
sunny_talwar

I am not sure I understand what isn't working? What is the issue that you are seeing?

martinpohl
Partner - Master
Partner - Master

go away to think reload datas in Qlik like you do that on SQL.

all datas from your database are in a Qlik application and by selecting datas the linked fields are reduced to selection.

So if you select a Region you see Tanks and Sides they are belong to.

With Qlik you are free in your datas, without waiting for reloading datas.

Anonymous
Not applicable
Author

Thank you for all your repies.I have managed to solve my issue using the Only() function while aggregating the entities of Region and Site from my datafield:

"=concat(DISTINCT aggr(only({<Region={$(vRegion)}>} Site),Site),',')".

The problem that I am facing right now is the following. When filtering the Tanks

"=concat(DISTINCT aggr(Only({<Site={$(vSite)}>} Tank),Tank),',')"

when the Site contains a whitespace character something isn't working right inside the expression and it returns a null string. Do you have possible solutions in mind? PS: I can change the whitespaces with an other special character like underscore when I load the data from the query but this isn't the right solution at the moment. I can contact with the people using the program that connects with the database to make sure they never use an underscore on a Site name but that's a last resort solution. Any ideas will be greatly appreciated!

Anil_Babu_Samineni

That means, You got the solution by your hand, So mark your response as correct answer

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful