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

Conditional Enablement

Hi Guys, I need some advice. We use conditional enablement to a large extend to enable users to create their own ad-hoc reports from a Pivot or Straight table view. We give them Selectable Fields (Dimensions) and Selectable Measures (Expressions) . It’s then also important for the users to create bookmarks on their selections and for the bookmark to remember the layout of the view and selections made for future use. The problem I have however is that if I add more selectable fields to Selectable Fields or Measures it breaks the bookmarks. Can you possibly assist in a logic that will cater for this? Script: Dim_CustomView_Mapping: Mapping LOAD ID,     DIM_ID as _Dim_ID FROM [http://$(vServerName):4780/QMS/AuthTable] (html, utf8, embedded labels, table is [Custom View Sort]); Exp_CustomView_Mapping: Mapping LOAD ID,     DIM_ID as _Exp_ID FROM [http://$(vServerName):4780/QMS/AuthTable] (html, utf8, embedded labels, table is [Custom View Sort]); AdHoc_Dimensions_tmp: LOAD * INLINE [ Selectable Fields Sales Channel Department ID Department Name Sub Dept ID Sub Dept Name Class ID Class Name Branch ID Branch Name Branch Type UPC SKU Barcode    Item Description UPC Type InActive Unit Customer ID Customer Name Supplier Supplier Product Code Unique Trans ID Trans No Station Receipt Fiscal Year Fiscal Month Fiscal Week Week Day Sale Date ]; AdHoc_Dimensions: NoConcatenate LOAD [Selectable Fields], ApplyMap('Dim_CustomView_Mapping',RowNo(),null()) as _Dim_ID, RowNo() as _Dim_Sort Resident AdHoc_Dimensions_tmp; DROP Table AdHoc_Dimensions_tmp; //_Dim_Sort //_Dim_ID AdHoc_Expressions_tmp: LOAD * INLINE [ Selectable Measures  Sales $ Avg Sell Price Current Avg Retail Price Avg Set Price Unit Cost Total Cost GM $ GM % Trans Count Sales Units Avg Trans Value Sales Cont GM Cont ]; AdHoc_Expressions: NoConcatenate LOAD [Selectable Measures], ApplyMap('Exp_CustomView_Mapping',RowNo(),null()) as _Exp_ID, RowNo() as _Exp_Sort Resident AdHoc_Expressions_tmp; DROP Table AdHoc_Expressions_tmp; Thanks in Advance

9 Replies
sujeetsingh
Master III
Master III

James it is too much confusing.

Can you please come in simple and clear script.

senpradip007
Specialist III
Specialist III

Could you please upload a sample qvw?

ssanchez
Partner - Contributor III
Partner - Contributor III

I have the same problem long time ago but I have not found a good solution, the changes in the data model break the bookmarks. We implemented a politic of changes to name and replace the bookmarks and use a button with actions to help in the process.

Hope this helps

ThornOfCrowns
Specialist II
Specialist II

I have hacked through the wall of text and I think that it should be:

Script:

Dim_CustomView_Mapping: Mapping
LOAD ID,    
DIM_ID as _Dim_ID FROM [http://$(vServerName):4780/QMS/AuthTable] (html, utf8, embedded labels, table is [Custom View Sort]);

Exp_CustomView_Mapping: Mapping LOAD ID,    
DIM_ID as _Exp_ID
FROM [http://$(vServerName):4780/QMS/AuthTable] (html, utf8, embedded labels, table is [Custom View Sort]);

AdHoc_Dimensions_tmp:
LOAD * INLINE
[ Selectable Fields
Sales Channel
Department ID
Department Name
Sub Dept ID
Sub Dept Name
Class ID
Class Name
Branch ID
Branch Name
Branch Type
UPC
SKU
Barcode   
Item Description
UPC Type
InActive Unit
Customer ID
Customer Name
Supplier
Supplier Product
Code Unique
Trans ID
Trans No
Station
Receipt
Fiscal Year
Fiscal Month
Fiscal Week
Week Day
Sale Date
];

AdHoc_Dimensions:
NoConcatenate
LOAD [Selectable Fields],
ApplyMap('Dim_CustomView_Mapping',
RowNo(),
null()) as _Dim_ID,
RowNo() as _Dim_Sort
Resident
AdHoc_Dimensions_tmp;

DROP Table AdHoc_Dimensions_tmp;

//_Dim_Sort //_Dim_ID AdHoc_Expressions_tmp:

LOAD * INLINE
[ Selectable Measures 
Sales
$ Avg
Sell Price
Current Avg Retail Price
Avg Set Price
Unit Cost
Total Cost
GM $
GM %
Trans Count
Sales Units
Avg Trans Value
Sales Cont
GM Cont ];

AdHoc_Expressions: NoConcatenate
LOAD
[Selectable Measures],
ApplyMap('Exp_CustomView_Mapping',RowNo(),null()) as _Exp_ID,
RowNo() as _Exp_Sort
Resident AdHoc_Expressions_tmp;
DROP Table AdHoc_Expressions_tmp;

Anonymous
Not applicable
Author

Hi James,

Yep that's the correct script. My apologies for the bad format. The outcome of the message came out much different after posting it.

Kind Regards

Anonymous
Not applicable
Author

Hi Santiago

Thanks for your feedback.

Do you control the bookmarks through Macro's?

Kind Regards

ssanchez
Partner - Contributor III
Partner - Contributor III

Hi James,

Yes, I control the bookmark through a macro but it's only a help to replace the bookmark and it's necessary that the user make the right new selections. The button call a macro to delete the BM01 user bookmark and create a new bookmark with the same ID. This thread can help Recall BM through macro code Create Bookmark using Macro

Regards

Anonymous
Not applicable
Author

Thanks for your feedback mate.

One more question. As far a I know macro's does not work in Ajax. Do you use Ajax
or the IE Plugin?

Kind Regards

ssanchez
Partner - Contributor III
Partner - Contributor III

The methods used in these macros do not always work in Ajax. To ensure implementation I use IE-Plugin for these users.


Regards