Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
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.......

1 Solution

Accepted Solutions
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.

View solution in original post

19 Replies
ravindraa
Creator
Creator
Author

Hi experts,

Please give me any suggesion on this.

sujeetsingh
Master III
Master III

Ravi,

I am confused a lot . Please explain in much detail

kushalthakral
Creator III
Creator III

Hi Ravindraa

Please mention clearly your requirement and if possible please attach sample qvd

Regards

Kushal Thakral

ravindraa
Creator
Creator
Author


Hi

  My requierment is i have to maintains Offices time present i mean how many hours he spent with parents ,students and with sports master (these activites values  maintains  one field that is Officer_presen), i am attaching sample file please find this.

1st feb how many hours he(officer) spent with student , parents and sports man(i have to follow one caliculation to get that field ) please find below  caliculation.

CALICULATION:

timespent with Parents_activity accompained with Student_activity +  timespent with Parents with out Studnet_activity + time in sports_activity.

jagan
Luminary Alumni
Luminary Alumni

Hi,

Can you explain with an example with your data and expected output.

Regards,

Jagan.

aveeeeeee7en
Specialist III
Specialist III

Not clear about your requirement. But as far as I've understood you can try below expression in your text box and see the result:


=Sum({<Officer_present={'Parents_activity','Student_activity'}>}time_spent)

+

Sum({<Officer_present={'Parents_activity'}>}time_spent)

+

Sum({<Officer_present={'sports_activity'}>}time_spent)

Snapshot.png

I've tried this expression and it is giving the Answer: 19

Hope that helps.

Regards

Aviral Nag

ravindraa
Creator
Creator
Author

Hi Jagan Mohan,

  i need to display the value like below

1/02/2014     - 7 hours.(time spent with student and parents + time spent with parents + time spent wtih sports)

02/02/2014   - 7 hours.

Please give me any suggesion.

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this

Dimension: officerdate

Expression: Sum({<Officer_present = {'Parents_activity', 'sports_activity', 'Student_activity'}>} time_spent)

Regards,

jagan.

ravindraa
Creator
Creator
Author

Hi jagan Mohan,

   thanks for help but can you give me suggession in EDIT script level because i have to use result field for another input.