Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

to find the existing year is a leap year

how can i find out that the existing year is a leap year. or how to calculate leap year

1 Solution

Accepted Solutions
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

   Yes you can use the field.

   But then you cant use the above expression in textbox, it should be used in a chart.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!

View solution in original post

6 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

   Here is the formula.

   =if(mod(Variable1,4) = 0 and mod(Variable1,100) <> 0 or mod(Variable1,400) = 0,'Leap','NotLeap')

   Here Variable1 hold the year.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

means instead of variable1 i have to write year field or wat ????????

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

   Yes you can use the field.

   But then you cant use the above expression in textbox, it should be used in a chart.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

i m using it at the back end:) and thank you and ny other logic realted to leap year

Not applicable
Author

i want to ask any other logic through flags and what are these flags and why we use it

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

   You can use the same in backend too.

   For example.

   Data:

   Load

   if(mod(Variable1,4) = 0 and mod(Variable1,100) <> 0 or mod(Variable1,400) = 0,'Yes','No')  as Leap Year

    From xyz.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!