Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
cbaqirdhds
Valued Contributor

GetFieldSelections and Set Analysis

My current expression is:

=if(PRIMARY_DECISION_BODY='ECG' and PRIMARY_DECISION_AGENDA_DATE=date(Min({$<AGENDA_DATE={">$(=today())"},GOV_DECISION_BODY_SUB={'ECG'}>}AGENDA_DATE),'MM/DD/YYYY'),1,
if(SECONDARY_DECISION_BODY='ECG' and SECONDARY_DECISION_AGENDA_DATE=date(Min({$<AGENDA_DATE={">$(=today())"},GOV_DECISION_BODY_SUB={'ECG'}>}AGENDA_DATE),'MM/DD/YYYY'),1,
if(THIRD_DECISION_BODY='ECG' and THIRD_DECISION_AGENDA_DATE=date(Min({$<AGENDA_DATE={">$(=today())"},GOV_DECISION_BODY_SUB={'ECG'}>}AGENDA_DATE),'MM/DD/YYYY') ,1,
if(FOURTH_DECISION_BODY='ECG' and FOURTH_DECISION_AGENDA_DATE=date(Min({$<AGENDA_DATE={">$(=today())"},GOV_DECISION_BODY_SUB={'ECG'}>}AGENDA_DATE),'MM/DD/YYYY'),1,
if(FIFTH_DECISION_BODY='ECG' and FIFTH_DECISION_AGENDA_DATE=date(Min({$<AGENDA_DATE={">$(=today())"},GOV_DECISION_BODY_SUB={'ECG'}>}AGENDA_DATE),'MM/DD/YYYY') ,1,
if(SIXTH_DECISION_BODY='ECG' and SIXTH_DECISION_AGENDA_DATE=date(Min({$<AGENDA_DATE={">$(=today())"},GOV_DECISION_BODY_SUB={'ECG'}>}AGENDA_DATE),'MM/DD/YYYY')
,1,0))))))

I need to make some selections based on GetFieldSelections. This is what I am using but it's not working:

=if(PRIMARY_DECISION_BODY=GetFieldSelections(GOV_DECISION_BODY_SUB) and PRIMARY_DECISION_AGENDA_DATE=date(Min({$<AGENDA_DATE={">$(=today())"},GOV_DECISION_BODY_SUB={"GetFieldSelections(GOV_DECISION_BODY_SUB)"}>}AGENDA_DATE),'MM/DD/YYYY'),1,
if(SECONDARY_DECISION_BODY=GetFieldSelections(GOV_DECISION_BODY_SUB) and SECONDARY_DECISION_AGENDA_DATE=date(Min({$<AGENDA_DATE={">$(=today())"},GOV_DECISION_BODY_SUB={"GetFieldSelections(GOV_DECISION_BODY_SUB)"}>}AGENDA_DATE),'MM/DD/YYYY'),1,
if(THIRD_DECISION_BODY=GetFieldSelections(GOV_DECISION_BODY_SUB) and THIRD_DECISION_AGENDA_DATE=date(Min({$<AGENDA_DATE={">$(=today())"},GOV_DECISION_BODY_SUB={"GetFieldSelections(GOV_DECISION_BODY_SUB)"}>}AGENDA_DATE),'MM/DD/YYYY') ,1,
if(FOURTH_DECISION_BODY=GetFieldSelections(GOV_DECISION_BODY_SUB) and FOURTH_DECISION_AGENDA_DATE=date(Min({$<AGENDA_DATE={">$(=today())"},GOV_DECISION_BODY_SUB={"GetFieldSelections(GOV_DECISION_BODY_SUB)"}>}AGENDA_DATE),'MM/DD/YYYY'),1,
if(FIFTH_DECISION_BODY=GetFieldSelections(GOV_DECISION_BODY_SUB) and FIFTH_DECISION_AGENDA_DATE=date(Min({$<AGENDA_DATE={">$(=today())"},GOV_DECISION_BODY_SUB={"GetFieldSelections(GOV_DECISION_BODY_SUB)"}>}AGENDA_DATE),'MM/DD/YYYY') ,1,
if(SIXTH_DECISION_BODY=GetFieldSelections(GOV_DECISION_BODY_SUB) and SIXTH_DECISION_AGENDA_DATE=date(Min({$<AGENDA_DATE={">$(=today())"},GOV_DECISION_BODY_SUB={"GetFieldSelections(GOV_DECISION_BODY_SUB)"}>}AGENDA_DATE),'MM/DD/YYYY')
,1,0))))))

Can anyone help with the syntax?

1 Solution

Accepted Solutions

Re: GetFieldSelections and Set Analysis

Here is the correct expression.


=if(GOV_DECISION_BODY_SUB='$(=GetFieldSelections(GOV_DECISION_BODY_SUB))',1,
if(GOV_DECISION_BODY_SUB='$(=GetFieldSelections(GOV_DECISION_BODY_SUB))',1,
if(GOV_DECISION_BODY_SUB='$(=GetFieldSelections(GOV_DECISION_BODY_SUB))',1,
if(GOV_DECISION_BODY_SUB='$(=GetFieldSelections(GOV_DECISION_BODY_SUB))',1,
if(GOV_DECISION_BODY_SUB='$(=GetFieldSelections(GOV_DECISION_BODY_SUB))',1,
if(GOV_DECISION_BODY_SUB
='$(=GetFieldSelections(GOV_DECISION_BODY_SUB))',1,0

))))))

7 Replies

Re: GetFieldSelections and Set Analysis

Hi Cassandra,

For single selection your expression should work. I am not sure what you are trying in the expression. Could you explain your question with an example. It will be really helpful for us to help you.

cbaqirdhds
Valued Contributor

Re: GetFieldSelections and Set Analysis

Attached is a sample. If you use either of the two buttons, I need the blank chart to populate with the relevant defect_id numbers.

2-2-2018 1-59-05 PM.jpg

Re: GetFieldSelections and Set Analysis

Fine. Here is the expression.

=if(PRIMARY_DECISION_BODY= '$(=GetFieldSelections(GOV_DECISION_BODY_SUB))' and PRIMARY_DECISION_AGENDA_DATE=date(Min({$<AGENDA_DATE={">$(=today())"},GOV_DECISION_BODY_SUB={'$(=GetFieldSelections(GOV_DECISION_BODY_SUB))'}>}AGENDA_DATE),'MM/DD/YYYY'),1,
if(SECONDARY_DECISION_BODY='$(=GetFieldSelections(GOV_DECISION_BODY_SUB))' and SECONDARY_DECISION_AGENDA_DATE=date(Min({$<AGENDA_DATE={">$(=today())"},GOV_DECISION_BODY_SUB={'$(=GetFieldSelections(GOV_DECISION_BODY_SUB))'}>}AGENDA_DATE),'MM/DD/YYYY'),1,
if(THIRD_DECISION_BODY='$(=GetFieldSelections(GOV_DECISION_BODY_SUB))' and THIRD_DECISION_AGENDA_DATE=date(Min({$<AGENDA_DATE={">$(=today())"},GOV_DECISION_BODY_SUB={'$(=GetFieldSelections(GOV_DECISION_BODY_SUB))'}>}AGENDA_DATE),'MM/DD/YYYY') ,1,
if(FOURTH_DECISION_BODY='$(=GetFieldSelections(GOV_DECISION_BODY_SUB))' and FOURTH_DECISION_AGENDA_DATE=date(Min({$<AGENDA_DATE={">$(=today())"},GOV_DECISION_BODY_SUB={'$(=GetFieldSelections(GOV_DECISION_BODY_SUB))'}>}AGENDA_DATE),'MM/DD/YYYY'),1,
if(FIFTH_DECISION_BODY='$(=GetFieldSelections(GOV_DECISION_BODY_SUB))' and FIFTH_DECISION_AGENDA_DATE=date(Min({$<AGENDA_DATE={">$(=today())"},GOV_DECISION_BODY_SUB={'$(=GetFieldSelections(GOV_DECISION_BODY_SUB))'}>}AGENDA_DATE),'MM/DD/YYYY') ,1,
if(SIXTH_DECISION_BODY='$(=GetFieldSelections(GOV_DECISION_BODY_SUB))' and SIXTH_DECISION_AGENDA_DATE=date(Min({$<AGENDA_DATE={">$(=today())"},GOV_DECISION_BODY_SUB={'$(=GetFieldSelections(GOV_DECISION_BODY_SUB))'}>}AGENDA_DATE
),'MM/DD/YYYY')
,1,0))))))


But I could not find any PRIMARY, SECONDARY, THIRD..... SIXTH DECISION BODY Data for the GOV_DECISION_BODY_SUB = > Interdisciplinary. So no Defect Id's will be displayed. Could you check and confirm.

Capture.PNG

cbaqirdhds
Valued Contributor

Re: GetFieldSelections and Set Analysis

You are right - the field should be PRIMARY_DECISION_COMMITTEE_CAT.

Re: GetFieldSelections and Set Analysis

But this time no AGENDA_DATE for Interdisciplinary. Please find the attached file and copy paste the chart in your application. This should work as per your requirement. All you need to do is check the column names and data.

Capture.PNG

cbaqirdhds
Valued Contributor

Re: GetFieldSelections and Set Analysis

How would the syntax look if I just used:

=if(GOV_DECISION_BODY_SUB={'$(=GetFieldSelections(GOV_DECISION_BODY_SUB))'}),1,
if(GOV_DECISION_BODY_SUB={'$(=GetFieldSelections(GOV_DECISION_BODY_SUB))'}),1,
if(GOV_DECISION_BODY_SUB={'$(=GetFieldSelections(GOV_DECISION_BODY_SUB))'}),1,
if(GOV_DECISION_BODY_SUB={'$(=GetFieldSelections(GOV_DECISION_BODY_SUB))'}),1,
if(GOV_DECISION_BODY_SUB={'$(=GetFieldSelections(GOV_DECISION_BODY_SUB))'}) ,1,
if(GOV_DECISION_BODY_SUB={'$(=GetFieldSelections(GOV_DECISION_BODY_SUB))'})
)
,1,0
))

Re: GetFieldSelections and Set Analysis

Here is the correct expression.


=if(GOV_DECISION_BODY_SUB='$(=GetFieldSelections(GOV_DECISION_BODY_SUB))',1,
if(GOV_DECISION_BODY_SUB='$(=GetFieldSelections(GOV_DECISION_BODY_SUB))',1,
if(GOV_DECISION_BODY_SUB='$(=GetFieldSelections(GOV_DECISION_BODY_SUB))',1,
if(GOV_DECISION_BODY_SUB='$(=GetFieldSelections(GOV_DECISION_BODY_SUB))',1,
if(GOV_DECISION_BODY_SUB='$(=GetFieldSelections(GOV_DECISION_BODY_SUB))',1,
if(GOV_DECISION_BODY_SUB
='$(=GetFieldSelections(GOV_DECISION_BODY_SUB))',1,0

))))))