Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

rsingh43
Contributor

HELP...Variable

Hi All,

I have created an app and require a variable but unsure how this is done.

My app has two sheets, one for imports and the other for exports. The import sheet has a filter for dest (destination) and the export has one for origin. I would like to create one filter, so if LHR is selected it will filter the import destination as LHR then the origin on export sheet as LHR.

Sheet 1 Imports:

Filter: Dest

Sheet 2 Exports:

Filter: Origin

Filter: LHR

Attached is a qvf of my app.

Thanks in advance for any help.

Tags (2)
14 Replies
agigliotti
Honored Contributor II

Re: HELP...Variable

why don't use the same field on both tables ?

rsingh43
Contributor

Re: HELP...Variable

Hi Andrea,

The imports and exports are two different datasets. So if I set dest as LHR for imports, the origin would be LHR for exports.

Which field do you mean I should use for both?

Thanks

balabhaskarqlik
Honored Contributor

Re: HELP...Variable

May be like this:

Sum({<Origin = {'$(=GetFieldselections(Destination))'}>}[Net Price])

One field selection into another field value.

balabhaskarqlik
Honored Contributor

Re: HELP...Variable

Try this too:

Sum({<Origin = p(Destinations)>}[Net Price])

agigliotti
Honored Contributor II

Re: HELP...Variable

could you define a single row as import or export ?

is there such a way to separate import rows from export rows ?

MVP
MVP

Re: HELP...Variable

I think you can do this using the concept of LinkTable...

LinkTable:

LOAD ID,

Dest as Location,

     'Destination' as Flag

Resident Imports_Exports;


Concatenate (LinkTable)

LOAD ID,

Origin as Location,

     'Origin' as Flag

Resident Imports_Exports;

And now have Location as filter on both tabs and select LHR in Location

rsingh43
Contributor

Re: HELP...Variable

Hi Sunny,

So I can keep my original script and create the below in a new section in data load editor?

LinkTable:

LOAD ID,

Dest as Location,

     'Destination' as Flag

Resident Imports_Exports;


Concatenate (LinkTable)

LOAD ID,

Origin as Location,

     'Origin' as Flag

Resident Imports_Exports;

MVP
MVP

Re: HELP...Variable

Yes

rsingh43
Contributor

Re: HELP...Variable

Hi Sunny,

I added the script as suggested but for imports, it is filtering on 'Origin' instead of 'Dest'. The exports column seem to be filtering fine.