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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
robert99
Specialist III
Specialist III

Selection Across Fields (not in expression or script)

I'm sure there is a simple way to do this but I can not get it to work

And I know it is possible to either (which I have done until now)

Set this up in an expression (as say  sum (if (OrderDate>DueDate etc)  or set up in script as a selectable / clickable field

But what I would like to do to make a selection as (to appear in the current selection box)

OrderDate > DueDate

I have not been able to get this to work

Thanks for any help

17 Replies
Not applicable

So u can try writing expression in Order number selection box like

if(OrderDate>DueDate,Order Number)

So it will only display order numbers where OrderDate>DueDate

MK_QSL
MVP
MVP

Considering that OrderDate and DueDate both are in different tables and they are connected via Order Number... like below

ORDER:

Load * Inline

[

Order Number,   Order date

123,            1/1/2014 

124,            2/1/2014 

125,            2/1/2014 

];

DUE:

Load * Inline

[

Order Number,DueDate

123,         1/1/2014

124,         10/1/2014

125,         1/1/2014

];

You can create a straight table

Dimension = Calculated Dimension

=Aggr(IF([Order date]>=DueDate,'Yes','No'),[Order Number]) //Change >= according to your need

Expression

COUNT(Distinct [Order Number])

Hope this helps..

robert99
Specialist III
Specialist III
Author

Thanks

I can do thsi in a expression dimension or script. but I was hoping I could do it from a selection (so it then appeared in the current selection box and would apply to all chart  and tables etc

MK_QSL
MVP
MVP

You can share your sample data or sample apps !

Will try to help you out.

robert99
Specialist III
Specialist III
Author

Yes. But I don't think it can be done

It can be done in script or an expression (or dimensions) not not as a one off easy selection

So it has just taken me an hour+ (to set up in script) whereas I was hoping it was a minute job. Say to type in OrderDate>DueDate

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

It can't be done in the way you are attempting. Selections are done for the whole set, whereas the expression in the chart is evaluated in the context of the dimension values - so the expression works in the chart but you can't filter it as a selection.

The correct way to do this has already been suggested. Create a flag field in the load like this when loading the orders:

LOAD

     ....

     If(OrderDate > DueDate, 1, 0) As [OrderDate>DueDate],

     ...

Now select the field [OrderDate>DueDate] to select the overdue orders.

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
robert99
Specialist III
Specialist III
Author

Thanks

Im surprised (and a little disappointed) that this can not be done. Everything else I have tried can be but I guess there are other ways to do this

But I have now set this option up in script. It was the better option compared to setting up in the expressions

robert99
Specialist III
Specialist III
Author

Thanks

This was the way I did this. I tried to avoid script but sometimes it has to eb done in script