Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
srikantj
Creator
Creator

comparing month year between two dates

hi

I have two dates

date1          date2

4/24/2016    5/14/2017

3/30/2017    6/17/2015

.

.

i want to compare  month year of date1 =  month year of date 2

and quarter year of date 1 = quarter year of date 2

Qliksss suggest

1 Solution

Accepted Solutions
vinieme12
Champion III
Champion III

use

if(QuarterName(Date1) = QuarterName(Date2) , Quantity , 0)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

10 Replies
tripatirao
Creator II
Creator II

Hi,

Can you please elaborate with example what u want.

Regards

srikantj
Creator
Creator
Author

There are two date fields

i just want to compare month year of one date to month year of another date

if(4/2016=5/2017, 1,0)

tresesco
MVP
MVP

May be like this?

InMonth(Date1, Date2, 0)

InQuarter(Date1, Date2,0)

dsharmaqv
Creator III
Creator III

Extract month and year for both fields

Month(date1)

Year(date1)

Month(date2)

Year(date2)

Now you can compare these derieved fields

incase you need month year then concatenate both fields

Date#(Month(date1)&', '&Year(date1) ,'MMM, YYYY') as Month_Year1

Date#(Month(date2)&', '&Year(date2),'MMM, YYYY') as Month_Year2

srikantj
Creator
Creator
Author

But i want to give expression if equals quantity  not true or false

srikantj
Creator
Creator
Author

i know this way but i want simple way

as i need to write other expressions based on that

tresesco
MVP
MVP

InMonth()/InQuarter() themselves return true or false. You can try like:  =If( InMonth(Date1,Date2,0), 'true', 'false')

dsharmaqv
Creator III
Creator III

what do you want to do exactly ?

srikantj
Creator
Creator
Author

if(quarter year date1=quarter year date 2,quantity,0)

is there any pre defined function??????