Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to refer to selection of a object which is not part of data model

Dear people,

I have a table which is not part of data mode (secondary tablel). I wanna apply its selections to update the expression in a table (main table) created by data model.

Let say I have a "base fee" and I would like to be able to apply 10% and 20% discounts on it. The discount options are available in a table and I want to update the value of the main table (charts) if any of these options is selected.

Is there a way to address the selections of the secondary table in an expression in the main table? For example by object number?

Thanks in advance

Mahdi

4 Replies
adamdavi3s
Master
Master

Yep so as long as you only have one basefee selected you could do something like

yourexpression * basefee

adamdavi3s
Master
Master

yep seems to work, please see the attached example

Please remember to mark this as helpful or the correct answer if I have helped you or answered your question.

This will help users identify the answers should they come across this thread in the future.

Not applicable
Author

Unfortunately, I can not open the file you have provided due to the fact that I use the free version of the software.

I wonder if you can elaborate on the formula:

yourexpression * only({1}basefee)

 

How a selection in a different table which is not part of the data model is realized in this formula?

Thanks,

Mahdi

adamdavi3s
Master
Master

No worries, just create a document with this load script, then create a chart table with the dimension of Department and two expressions, one which is Sum(Value) and one which is Sum(Value) * basefee

then create a list box for basefee, make a selection and see what happens

lookup:

LOAD * Inline [

basefee

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

];

Transactions:

Load

'1' as TransCounter,

TransLineID,

TransID,

mod(TransID,26)+1 as Num,

Pick(Ceil(5*Rand1),'A','B','C','D','E') as Department,

Pick(Ceil(6*Rand1),'0','1','2','3','4','5') as Status,

Pick(Ceil(2*Rand1),'0','1') as OverdueFlag,

makedate(Ceil(2017-(3*Rand())),Ceil(12*Rand()),Ceil(28*Rand())) as OrderDate,

date(if(100*rand() >5,makedate('2017',Ceil(12*Rand1),Ceil(28*Rand1)),null())) as ShippedDate,

money(round(RAND()*25000,0.01)) AS Value;

Load

Rand() as Rand1,

IterNo() as TransLineID,

RecNo() as TransID

Autogenerate 10000

While Rand()<=0.5 or IterNo()=1;