Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
ravindraa
Creator
Creator

how to get selected values

Hi all,
I have one requierment that i need to caliculate the "officeer time present" based on the caliculation.

caliculation part:

->Calicuationfield= timespent with Parents_activity accompained with Student_activity +  timespent with Parents with out Studnet_activity + time in sports_activity.

Officer_present                       <-this is the field name

Student_activity
Parents_activity
sports_activity
Travellig_activity
other_activity


To get this in edit script i have wrote below logic please find.

/////// in the EDIT SCRIPT LEVEL i wrote this code/////////////////////////////

load *,

if(Officer_present='Parents_activity' or 'Student_activity',
                          if(Officer_present='Parents_activity' ,
                            if(Officer_present='sports_activity',time_spent_activity))) as Calicuationfield;

sql  *from Officer_present_table;

Please give any suggesion to get the values.

Thanks in advance.......

19 Replies
jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this

LOAD

*,

If(Match(Officer_present , 'Parents_activity', 'sports_activity', 'Student_activity'), time_spent) AS Filter_time_spent

FROM DataSource;

Now use Filter_time_spent wherever you want.


Hope this helps you.


If you got the solution please Close this thread by giving Correct and Helpful answers to the posts which are helpful.


Regards,

Jagan.

ajaykumar1
Creator III
Creator III

Hi,

can you try this in edit script;

1)      if(wildmatch(Officer_present,'Parents_activity', 'sports_activity', 'Student_activity'),'CALCULATION') as OFFICER_PRESENET_DERIVED   //if you want only Parents_activity,sports_activity,Student_activity

2)     if(wildmatch(Officer_present,'Parents_activity', 'sports_activity', 'Student_activity'),'CALCULATION',Officer_present) AS OFFICER_PRESENET_DERIVED2 //if you want other values of Officer_present

Regards,

Ajay

ravindraa
Creator
Creator
Author

Thanks Jagan Mohan,

  it is working fine.

ravindraa
Creator
Creator
Author

Thanks ajay ajay,

  it is working fine.

ravindraa
Creator
Creator
Author


Thanks Aviral Nag,

    but it is display the all time activitys. but it is working fine.

ravindraa
Creator
Creator
Author

HI sujeeti singh,

  i hope you find the my attachment file

now it is working fine.


ravindraa
Creator
Creator
Author

Hi Jagan Mohan,

  It is working fine when  the officere time spent with parents_activity , sports_activity and studnet_activity

If(Match(Officer_present , 'Parents_activity', 'sports_activity', 'Student_activity'), time_spent) AS Filter_time_spent

Here we need to caliculate when officer time spent with sports_activity,student_activity and parents_activity or other_activity .

In this case how to add the  parents_activity or other_activity .

Please give me any suggession.

Thaks in advance.

ajaykumar1
Creator III
Creator III

Hi,

Try this;

If(Match(Officer_present , 'Parents_activity', 'sports_activity', 'Student_activity'), time_spent) AS Filter_time_spent,

If(Match(Officer_present , 'Parents_activity', 'sports_activity', 'Student_activity','other_activity'), time_spent2) AS Filter_time_spent2


Note : sports_activity,student_activity and parents_activity or other_activity .  Please explain what is AND,OR yo mentioned.


Regards,

Ajay

ravindraa
Creator
Creator
Author

Hi ajay ajay,

  and is commonly write to divide the 3 words but i have to get time spent  with parent_activity or otheractivity along with studnet_activity,sports_activity.

please give me any suggession on this..

ajaykumar1
Creator III
Creator III

Hi,

Try this;

1)      if(Officer_present='Student_activity' and Officer_present='sports_activity' or Officer_present='Parents_activity' or     Officer_present='other_activity',time_spent,Officer_present) as NEW_FIELD;

2 )    if(Officer_present='Student_activity' and Officer_present='sports_activity' or Officer_present='Parents_activity',time_spent,

if(Officer_present='Student_activity' and Officer_present='sports_activity' or Officer_present='other_activity',time_spent,Officer_present)) as NEW_FIELD;

Regards,

Ajay