Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys,
i have created a pivot table. in my correctio column, actually consists of value C,D.
But my client wants to have a selection box which can give the client a choice of choosing view "C Only", "D Only", "C & D" , "All".
So, i do not know how to create this filter. I have tried to create in the script editor as such:
if(correctio_tip = 'c', 'C',
if(correction_tip='d','D',
if(correction_tip='c' or 'd', 'C & D')))
Help help help
Rgds
Jim
Hi Jim:
If you want to add more fields on group by, yo need to include it on LOAD:
LEFT JOIN Competition
LOAD
cust_id,
date,
starttime
concat(DISTINCT correctio_tip,'&') as MyField2
RESIDENT Competition
//if you want, you can add more fields to group, like categories or dates
GROUP BY cust_id, date, starttime;
MyFilter:
LOAD DISTINCT MyField2 as MyFilter RESIDENT Competition;
CONCATENATE
LOAD 'All' as MyFilter AUTOGENERATE 1;
Regards!!!
Create a listbox with correction_tip as field. Then let the client select only C or select only D or select C and D both or select nothing which means select all. It's standard functionality. No need to muck about trying to create something that already exists and works.
That i know, Gysbert. but i have situation as such that i have created a listbox using field correctio_tip. so this listbox there is "C" , "D".
So when i select/highlight "C" and "D" , it listed out all the Cs and Ds.
i wanted a list box when i select " C & D" then it will only show me customer ID - 80100317 with correctio_id of "C & D" only.
Rgds,
Jim
Hi Jim,
Create a new field with C,D, C&D, All, with only one selection.
On field triggers, create a new action on your new field to select values on correctio_id:
IF(GetSelectedCount(NewField)=1 and (NewField='C' or NewField='D'), NewField,
If(GetSelectedCount(NewField) = 1 and NewField = 'C&D', '(C|D)', ''))
Regards!!
Ah, like that. Ok try creating a new table with a new field:
NewTable:
LOAD DISTINCT
cust_id,
correction_tip as Newfield
RESIDENT
ExistingTableWithCustIDAndCorrectionTip
;
CONCATENATE (NewTable)
LOAD
cust_id,
concat(correction_tip, ' & ', correction_tip) as Newfield
RESIDENT
ExistingTableWithCustIDAndCorrectionTip
GROUP BY
cust_id
;
let me try this bro.
let you know in a while.
Gysbert,
i have followed your steps, something is not right though... it gave me a long list - in a listbox. like this:
Rgds
Jim
Ah, yes of course. Try this for the second part:
CONCATENATE (NewTable)
LOAD
cust_id,
concat(NewField, ' & ', NewField) as Newfield
RESIDENT
NewTable
GROUP BY
cust_id
;
maybe u r rite... wait... maybe i need 1 more key.
Hi Jim,
Try this expression. I hope it will works.
IF(GetSelectedCount(Correction)=1 and (Correction='C' or Correction='D'), Correction,
If(GetSelectedCount(Correction) = 1 and Correction= 'C&D', '(C|D)', '')).
Thanks,