Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

is the store open? If-statements

Hello!

I just got some help, but i need some more

I have the following expression:

=time(Frac(now(1)))>Open AND time(Frac(now(1)))<Close AND PRU = 'A' AND AREA = 'B'

I have two list boxes also whitch show PRU and AREA.

I want to have several gauge chart showing the different PRU and AREAS and if they are open or not.

So i wanna have one for PRU A and AREA A, Then one for PRU A and AREA B etc.

I dont want to make any selection within this application. I want the user just to see if the store i open right now or not.

This does not work atm. If i choose PRU A and AREA B in the listbox i get the right answer (-1 for open and 0 for closed).

How can i get this to work?

Thanks!

10 Replies
Not applicable
Author

Anyone please?

Something like this i guess

Sum({<AREA={"B">} time(Frac(now(1)))>Open AND time(Frac(now(1)))<Close)

But i want PRU aswell.

Anonymous
Not applicable
Author

here you would need a straight or pivot table as you don't have to make any selections and could have a mini gauge chart for the open/close field. you think you can provide sample file/data?

Not applicable
Author

Can't i just make pre selections in the expression? Something like:

Sum({<AREA={"B">} time(Frac(now(1)))>Open AND time(Frac(now(1)))<Close)

I don't want to use Sum but i want it only to check for AREA B and PRU A.

How can i solve it with Pivot and/or Straight table?

lironbaram
Partner - Master III
Partner - Master III

hi have a look at the attachment

hope this what you are looking for

jerem1234
Specialist II
Specialist II

You want an expression for each combination of PRU and Area for different gauges? Try wrapping the Close and Open fields with only and set analysis like:

time(Frac(now(1)))>only({<PRU={'A'}, AREA = {'A'}>}Open) AND time(Frac(now(1)))<only(({<PRU={'A'}, AREA = {'A'}>}Close)


Then you can do the same for the others:


time(Frac(now(1)))>only({<PRU={'A'}, AREA = {'B'}>}Open) AND time(Frac(now(1)))<only(({<PRU={'A'}, AREA = {'B'}>}Close)


....


Hope this helps!

Not applicable
Author

Sorry, but there is error in expression, so i can't try it.

But yes, I want different gauge chart showing green och red light for each PRU A AREA A, PRU A AREA B etc.

Not applicable
Author

Sorry, can't open, im on a private license 😕

jerem1234
Specialist II
Specialist II

I added an extra '(' on accident:

time(Frac(now(1)))>only({<PRU={'A'}, AREA = {'A'}>}Open) AND time(Frac(now(1)))<only({<PRU={'A'}, AREA = {'A'}>}Close)


time(Frac(now(1)))>only({<PRU={'A'}, AREA = {'B'}>}Open) AND time(Frac(now(1)))<only({<PRU={'A'}, AREA = {'B'}>}Close)

lironbaram
Partner - Master III
Partner - Master III

here is the screen shot

Picture1.jpg