Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Oliver,
I played around with your issue by mocking up a Vendors table and implementing a Selections table; my Vendors table has only four columns: Code, Name, Group and Value; I added 10 dummy vendors with silly names, two groups (G1, G2) and funny values 🙂; I also created a variable vVendorList mimicking the list of vendors with special treatment. This is my script, out of this script perhaps the Selections table and the vVendorList variable as important to you, so keep an eye on them.
NoConcatenate
Vendors:
Load * Inline [
Code, Name, Group, Value
111,A,G1,123
112,B,G2,234
113,C,G1,555
114,D,G1,333
115,E,G2,222
116,F,G1,1123
117,G,G2,1234
118,H,G1,1555
119,I,G1,1333
120,J,G2,1222
];
NoConcatenate
Selections:
Load * Inline [
OptValue
All
Special
];
Set vVendorList=['111','115','118'];
The vendor list for this tests are 111, 115 and 118; The Selections table has two options: All and Special; The test user interface is shown below:
It has 5 panels:
The screenshot shows the UI when the Special selection is taken, e.g. the vendor list; The Panel 3 with the Straight Table will not work for us, as you can see the Table on Panel 3 shows the vendors in the Vendors List variable, that is what you want to achieve. None of the vendors on the Vendors List belong to the group G2, so it is not showing; Panel 2 shows our current selection and Panel 1 is the selector.
Let's comment on the expressions behind each panel:
Panel 1: It is just the selector on the column =OptValue.
Panel 2: It is actually our current selection, its expression is: =GetFieldSelections(OptValue)
Panel 3: It is the Straight table, it will never show us the results we want, anyhow, it has two expressions; The Code column expression is:
=if(GetFieldSelections(OptValue)='All', Code, if(match(Code,$(vVendorList))=0, Null, Code))
While the Sales column expression is:
=if(GetFieldSelections(OptValue)='All', Sum(Value), Sum( {$<Code={$(vVendorList)}>} Value))
I will explain these expressions later.
Panel 4: The Table, it also has two expressions, exactly the same expression implemented into the Straight Table (Panel 3); Here, on the Code column we un-selected the option Include null values.
Panel 5: The Graphic shows Sales per Group for All or the Vendor List; We implemented this expression on the bar column:
=if(OptValue='All', Group, 'G1')
I am cheating here, because the Group selection is not driven by the Vendor List, this is a false positive.
The formulas:
Please review my reply, writing it help me to sharp my Qlik skills, so I hope it helps you to manage your data as required.
Best regards,
Arnaldo Sandoval
try this
={$< [vendors]={A,F,R,Y,AB} >} [vendors]
hi,
thanks for the answer, it doesn't works.
any suggestion?
Hi Oliver
Can you try removing the [Code Vendeur] at the end of your expression!
Hope this helps,
Arnaldo Sandoval
Hi Arnaldo,
it doesn't works.
i still have the alert "garbage after the expression $"
i tried to create a new dimension, with the original table, but i don't have possibility to add the limitation.
perhaps because I don't use the right action?
Hi Oliver,
Are you counting Vendors? perhaps you should include a COUNT() or SUM() function, like this
=Count( {$<[Code Vendeur]={ ... } > } [Code Vendour] )
The code just count the [Code Vendour] for just the one on the list, (I guess it should return 😎 but you probable want to SUM one of their measures, like sales, in that case, replace the second [Code Vendour] with the column you want to SUM.
Hope this helps,
Arnaldo Sandoval
no,
I don't want to count, I just want conserve a few list of vendors, and create a new dimension with them. I try to create this dimension with an existant table, named [vendors]
I tried your proposition but it doesn't work (gave "unvalid dimension")
the existant dimension is
=[vendors]
[vendors] has several items
the new one is on the same table [vendors], but with a limited list of them. (take 10 of X thousand items)
I'm Sorry for my wonderful Frenglish! 😉
Hi Oliver,
I am working on a solution to your problem, I will get back to you in about two hours, as I have something to do in that time! actually I got it working but I want to polish it a bit.
Regards,
Arnaldo Sandoval
thank you Arnaldo, take your time, no worry!
Hi Oliver,
I played around with your issue by mocking up a Vendors table and implementing a Selections table; my Vendors table has only four columns: Code, Name, Group and Value; I added 10 dummy vendors with silly names, two groups (G1, G2) and funny values 🙂; I also created a variable vVendorList mimicking the list of vendors with special treatment. This is my script, out of this script perhaps the Selections table and the vVendorList variable as important to you, so keep an eye on them.
NoConcatenate
Vendors:
Load * Inline [
Code, Name, Group, Value
111,A,G1,123
112,B,G2,234
113,C,G1,555
114,D,G1,333
115,E,G2,222
116,F,G1,1123
117,G,G2,1234
118,H,G1,1555
119,I,G1,1333
120,J,G2,1222
];
NoConcatenate
Selections:
Load * Inline [
OptValue
All
Special
];
Set vVendorList=['111','115','118'];
The vendor list for this tests are 111, 115 and 118; The Selections table has two options: All and Special; The test user interface is shown below:
It has 5 panels:
The screenshot shows the UI when the Special selection is taken, e.g. the vendor list; The Panel 3 with the Straight Table will not work for us, as you can see the Table on Panel 3 shows the vendors in the Vendors List variable, that is what you want to achieve. None of the vendors on the Vendors List belong to the group G2, so it is not showing; Panel 2 shows our current selection and Panel 1 is the selector.
Let's comment on the expressions behind each panel:
Panel 1: It is just the selector on the column =OptValue.
Panel 2: It is actually our current selection, its expression is: =GetFieldSelections(OptValue)
Panel 3: It is the Straight table, it will never show us the results we want, anyhow, it has two expressions; The Code column expression is:
=if(GetFieldSelections(OptValue)='All', Code, if(match(Code,$(vVendorList))=0, Null, Code))
While the Sales column expression is:
=if(GetFieldSelections(OptValue)='All', Sum(Value), Sum( {$<Code={$(vVendorList)}>} Value))
I will explain these expressions later.
Panel 4: The Table, it also has two expressions, exactly the same expression implemented into the Straight Table (Panel 3); Here, on the Code column we un-selected the option Include null values.
Panel 5: The Graphic shows Sales per Group for All or the Vendor List; We implemented this expression on the bar column:
=if(OptValue='All', Group, 'G1')
I am cheating here, because the Group selection is not driven by the Vendor List, this is a false positive.
The formulas:
Please review my reply, writing it help me to sharp my Qlik skills, so I hope it helps you to manage your data as required.
Best regards,
Arnaldo Sandoval