Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
On Demand Webinar: See Why Thousands of QlikView Users Have Switched to Qlik Sense. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
dominicanlauf
Contributor III
Contributor III

If-Function instead of number

Hello everybody,  

I have a question regarding a function that I have set up to record all the production operations of a lathe until 19 o'clock. Now I don't want to record until 19 o'clock, but as long as the machine is operated by production staff.

This information is stored in an event log. If the machine.event = 'manned', the machine.event.end should be used as the end time (at the position of 19). The current function is:

sum ({<LatheStatistics.START_TIME = {"= hour (LatheStatistics.START_TIME) <19"}>} LatheStatistics.END_TIME-LatheStatistics.START_TIME) * 24

How should I phrase the expression if I want : if (machine.event = "manned", hour (machine.event.end)) instead of 19?

Many Thanks,

Dominic

1 Solution

Accepted Solutions
Anil_Babu_Samineni

Do you mean this?

sum ({<LatheStatistics.START_TIME = {"= hour (LatheStatistics.START_TIME)<if (machine.event = "manned", hour (machine.event.end))"}>} LatheStatistics.END_TIME-LatheStatistics.START_TIME) * 24

Or

sum ({<LatheStatistics.START_TIME = {"=if (machine.event = "manned", hour (machine.event.end))"}>} LatheStatistics.END_TIME-LatheStatistics.START_TIME) * 24

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)

View solution in original post

4 Replies
Anil_Babu_Samineni

Do you mean this?

sum ({<LatheStatistics.START_TIME = {"= hour (LatheStatistics.START_TIME)<if (machine.event = "manned", hour (machine.event.end))"}>} LatheStatistics.END_TIME-LatheStatistics.START_TIME) * 24

Or

sum ({<LatheStatistics.START_TIME = {"=if (machine.event = "manned", hour (machine.event.end))"}>} LatheStatistics.END_TIME-LatheStatistics.START_TIME) * 24

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)

View solution in original post

dominicanlauf
Contributor III
Contributor III

Thanks for replying!

I mean the first variant.

But it doesn't work at all!

Anil_Babu_Samineni

When you say, It is not working. My suggest would explain way like

1) Where it is not working

2) What it is not working

3) If this expression says okay, Does values are not matched?

etc.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
dominicanlauf
Contributor III
Contributor III

My fault, it works!

 

Thank you!