Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
ioannagr
Creator III
Creator III

Cytd- lytd

Hello everyone.

I created a master calendar which contains CurYTDFlag and LastYTDFlag.

I have a field 

If(([status] = 'blabla' or [status] ='έγινε ολοκλήρωση ερωτηματολογίου' or
[status] = 'blabla' and Len(unitnumber)=12 ,'1', '0') as  donation

and so  i want to get CYTD-LYTD count of donations.

I've thought to do this  but it doesn't work

count({$< CurYTDFlag={1}, Year=, Month= >}
aimodotisi='1')
-
count({$< LastYTDFlag={1}, Year=, Month= >}
aimodotisi='1')

 

Other solutions I have found include an AutoCalendar. How do I involve this?

 

Help!

 

 

Thanks ,

Ioanna

4 Replies
Stoyan_Terziev
Partner - Creator III
Partner - Creator III

Hello,

I think you got it almost right.

Probably try changing this:

If(([status] = 'blabla' or [status] ='έγινε ολοκλήρωση ερωτηματολογίου' or
[status] = 'blabla' and Len(unitnumber)=12 ,'1', '0') as  donation

 

 

count({$< CurYTDFlag={1}, Year=, Month= >}
aimodotisi='1')
-
count({$< LastYTDFlag={1}, Year=, Month= >}
aimodotisi='1')

to this:

If(([status] = 'blabla' or [status] ='έγινε ολοκλήρωση ερωτηματολογίου' or
[status] = 'blabla' and Len(unitnumber)=12 ,1,0) as  donation // No ''' signs



Sum({$< CurYTDFlag={1}, Year=, Month= >} donation)-

Sum({$< LastYTDFlag={1}, Year=, Month= >} donation)

 

I hope that helps!

 

Kind regards,
S.T.

ioannagr
Creator III
Creator III
Author

It only worked when I did

count({$< CurYTDFlag={1}, Year=, Month= >} donation=1)- count({$< LastYTDFlag={1}, Year=, Month= >} donation=1)

 

and put count instead of sum.

 

Do you think this is correct?

 

Many thanks!

Stoyan_Terziev
Partner - Creator III
Partner - Creator III

Hi Ioanna,

 

It's weird that count({$< CurYTDFlag={1}, Year=, Month= >} donation=1) works but this:

Sum({$< CurYTDFlag={1}, Year=, Month= >} donation) doesn't. This can probably be explained by the data model.

 

Still if you want to use Count, you should do it like this to ensure it will be working with any selections:

count({$< CurYTDFlag={1}, Year=, Month=,donation={1} >} donation)

 

I hope that helps!

 

Regards,

S.T.

ioannagr
Creator III
Creator III
Author

Your help means a lot!

 

😁