Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Unable to select current selection show data on toggle between switch

Hi Experts,

I am working on application where I need to toggle between two switches ("Notice Only"  and  "Notice with Parts").

On particular filter selection, I should be able to show the relevant data in both tables. I have attached the sample_reduced_data file with it. How to achieve this?

Abhijit

1 Solution

Accepted Solutions
sunny_talwar

I think your issue is that your LinkTable. The way it is structured today, where you concatenate the RecID keys from two tables, it is creating a table where there is only value for one or the other is possible.

Capture.PNG

So when OriginalTable_RecID is available DistinctTable_RecID is missing and vice-versa. May be you need to do a left join instead of performing a concatenate here

LinkTable:

NoConcatenate

Load *

Resident LinkTableTemp

Where Date <> '03/05/1900' AND Date > '12/31/2014';

Left Join (LinkTable)

LOAD *

RESIDENT LinkTableTempDistinct

Where Date <> '03/05/1900' AND Date >= '12/31/2014';

Drop Table LinkTableTemp, LinkTableTempDistinct;

Having said that, I did have a work around for you in the application. Change your expressions for Notice Only table to add this set analysis in them

{<$(=Concat({<$Table = {'OriginalTable'}>}$Field, ', ')), DistinctTable.RecID = p(OriginalTable.RecID)>}

This is basically saying that you need to ignore any selection in OriginalTable and show rows where DistinctTable.RecID = OriginalTable.RecID.

So you expression will now look like this

Only({<$(=Concat({<$Table = {'OriginalTable'}>}$Field, ', ')), DistinctTable.RecID = p(OriginalTable.RecID)>} DistinctTable.NOTICE)

Only({<$(=Concat({<$Table = {'OriginalTable'}>}$Field, ', ')), DistinctTable.RecID = p(OriginalTable.RecID)>} DistinctTable.CPSC)

...

and so on

Thing to note here:

1) Expression will show error in the syntax editor, but don't be concerned because its just saying that synatx editor is having difficulty in understand the code because of the dollar sign expansion I have in there, but it should have no problem in displaying the required output for you.

2) Make no selections in the DistinctTable filters, all selections should now be made in OriginalTable filters and all those filters will flow through our logic in the set analysis field.

I am attaching your qvw back again for you to test this out and see if this is what you wanted.

Best,

Sunny

View solution in original post

6 Replies
sunny_talwar

What is relevant here? I am not sure I understand the desired output?

Not applicable
Author

Hi Sunny,

Hereby I try to explain you what I am facing the issue with:

1. I clicked the button "Notice with parts" with all filters cleared. I will get all the records with respective values in the table.

2. Now I want to filter this data by applying filter selection on "Notice". Lets select notice no as "A110E13115222000". After this selection, I can see JOB STATUS REPORT (NOTICE WITH PARTS)  having 6 records.

3. Now, I want to see the table with Notice only view. So if I click the button "NOTICE ONLY", I should be able to see a single record. But I don't see anything getting populated there.

4. Now I am clearing the current selection by clicking button "CLEAR SELECTIONS". Now I can see all the values in the table report JOB STATUS REPORT (NOTICE WITHOUT PARTS)

5.  After selecting the same filter notice no as mentioned above I should able to see a single record. But I don't see it. But if I select another filter before selecting that one then I could able to see that one record.

I hope this is bit clear now. How to achieve this.?

Abhijt

sunny_talwar

I think your issue is that your LinkTable. The way it is structured today, where you concatenate the RecID keys from two tables, it is creating a table where there is only value for one or the other is possible.

Capture.PNG

So when OriginalTable_RecID is available DistinctTable_RecID is missing and vice-versa. May be you need to do a left join instead of performing a concatenate here

LinkTable:

NoConcatenate

Load *

Resident LinkTableTemp

Where Date <> '03/05/1900' AND Date > '12/31/2014';

Left Join (LinkTable)

LOAD *

RESIDENT LinkTableTempDistinct

Where Date <> '03/05/1900' AND Date >= '12/31/2014';

Drop Table LinkTableTemp, LinkTableTempDistinct;

Having said that, I did have a work around for you in the application. Change your expressions for Notice Only table to add this set analysis in them

{<$(=Concat({<$Table = {'OriginalTable'}>}$Field, ', ')), DistinctTable.RecID = p(OriginalTable.RecID)>}

This is basically saying that you need to ignore any selection in OriginalTable and show rows where DistinctTable.RecID = OriginalTable.RecID.

So you expression will now look like this

Only({<$(=Concat({<$Table = {'OriginalTable'}>}$Field, ', ')), DistinctTable.RecID = p(OriginalTable.RecID)>} DistinctTable.NOTICE)

Only({<$(=Concat({<$Table = {'OriginalTable'}>}$Field, ', ')), DistinctTable.RecID = p(OriginalTable.RecID)>} DistinctTable.CPSC)

...

and so on

Thing to note here:

1) Expression will show error in the syntax editor, but don't be concerned because its just saying that synatx editor is having difficulty in understand the code because of the dollar sign expansion I have in there, but it should have no problem in displaying the required output for you.

2) Make no selections in the DistinctTable filters, all selections should now be made in OriginalTable filters and all those filters will flow through our logic in the set analysis field.

I am attaching your qvw back again for you to test this out and see if this is what you wanted.

Best,

Sunny

Not applicable
Author

Hi Sunny,

Thank you for the much need explanation. You arrived with the right answer according to my question I asked you. But here I am facing some issues with filtering. It works perfectly fine with NOTICE filter. What if I need to filter according to CAD SUPERVISOR, DESIGNER, ENGINEER or any other attribute filters available? 

Suppose I am selecting a CAD SUPERVISOR value as "DCROSS", it will show all the records with CAD SUPERVISOR DCROSS in table JOB STATUS REPORT (NOTICE WITH PARTS) but it will not show the records with CAD SUPERVISOR DCROSS in NOTICE ONLY view.

On selection of any filter or combination of filter it should show the respective rows in both tables. How to achieve this?

Abhijit

sunny_talwar

acnikhade‌ -

I think in order to allow for better selection, I would suggest creating a better join in the script. If changing in the script isn't possible, we can look for a better expressions on the front end. But before I do that, it would be good to know if you can make changes in the script.

Best,

Sunny

Not applicable
Author

Hi Sunny,

Thank you so much for your help. I restructured my data model so that I don't have to handle much stuffs in script. Now it looks pretty descent. You always come out as a great help.

Abhijit