Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I have a problem to create a button select an element from the result of another selection.
Target:
1. Select the latest "Date".
2. Based on the latest Date, the column Name can have multiple result.
3. Select only one Name from step 2.
Is there some thing like below:
somefunction({<Date={'$(=only(max({<Date={"<=01-10-2014 0:00:00"}>}Date)))'}>}Name)
that can select only one (the top one) Name from the Name list?
This is like to use array[1] in php, but I do not know how to select it in qlikview.
Can any one help?
THanks very much
Hi, for the Select Name Button you can select:
=MinString({<Date={'$(=only(Date))'}>}Name)
Hi,
If you need the "Name" field, one way could be a combination of aggr function with FirstSortedValue
FirstSortedValue(Name, -aggr(sum/max/rank({<Date={"<=01-10-2014 0:00:00"}>value),Name))
The expression is only an approach.
@German,
Sorry, I made a mistake. It still dose not work.
It works only when the max(Date) and Name are 1-1 match. If for a max(Date), there are multiple value in Name column. Then the result is null.
If you could upload and example of your model, maybe I can solve the problem.
aggr function is like a group by function.
Maybe, you need to add the Date into the dimmension
FirstSortedValue(Name, -aggr(sum/max/rank({<Date={"<=01-10-2014 0:00:00"}>value),Date,Name))
and/or use the rank function, to sort the result/limit it.
With and example of your model will be much easy to help you.
Hi, All
Happy 2015!!
I still have this problem. My target is to have two buttons: 1st button is to select a Date (Step 1 in the example), and then run a macro to press the 2nd button to select the Name for the Name list box(Step 2 in the example ).
And attached is a example .qvw file.
Case 1:You can see when you click on button "SelectDateOneName", and then click on button "SelectName", it works.
Case 2:But when you "SelectDateMultiName", then my solution dose not work.
I am wondering in case 2, how can I select all result and one result (only Name1, first one order by alphabet) in the "Name list box".
Thanks very much
Hi, German,
Thanks for all your help. And happy new year.
I attached an example .qvw file.
Zhihong
Hi, for the Select Name Button you can select:
=MinString({<Date={'$(=only(Date))'}>}Name)
Hi, Ruben,
Thanks very much. Your suggestion works to select one Name out.
Do you know in case 2, how can I have all Name selected (Both Name1 and Name2)?
Thanks
Here you have an example.
When I select a project auto selected date max in other variable
Hi, to select all names you can use:
='('&Concat({<Date={'$(=only(Date))'}>}Name,'|')&')'