Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to make a custom counter into if function when scripting

Hello all,

I'm new in Qliksense and  I need to make two counters like here .

counter = 0

counter1= 1

if ([recurring.start_date] > [appointments.start_date] or [recurring.end_date]< [appointments.end_date])   and [recurring.kind]='open' then

counter = counter+1;

else

counter1= counter1 +1;

end if ;

there is two tables with  columns start and end dates .  ( recurring and appointment) one counter for the appointments withing recurrent dates and one counter for the appointments outside the recurrent  .

i don't know if it works because i didn't find  the counters in the other views .

i don't even know if this might be done in scripting part.

Thanks

12 Replies
Not applicable
Author

Can anyone help me ?
Thank you

Not applicable
Author

When I delete the  '"resident [appointments];" there is no error in the script but I  can't found my counters in the other views .

recurring_events:

LOAD Sum(If([recurring.start_date]>[appointments.start_date] or [recurring.end_date]<[appointments.end_date] and [recurring.kind]='open' , 1, 0) ) AS counter,

                   

Sum(if ([recurring.start_date] > [appointments.start_date] or

[recurring.end_date]< [appointments.end_date]

and [recurring.kind]='open', 0, 1)) AS counter1

resident [appointments];

LET vsCounter = Peek('counter', 0, 'recuring_events');

LET vsCounter1 = Peek('counter1', 0, 'recurring_events');

can i remplace the script by a calculated expression after ?

i think i didn't understand qliksens well

OmarBenSalem

Hi Moez,

I would suggest you demand a Qlik training session from your employer to have the minimum skills required to work with Qlik.

We can put time to help you solving this problem  (we need to alter your script and combine your tables/change your change field names etc)..

BUT that won't be of any help to you.

Greetings,

Omar,