Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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!
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!
I am not sure I understand what isn't working? What is the issue that you are seeing?
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.
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!
That means, You got the solution by your hand, So mark your response as correct answer