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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
apthansh
Creator
Creator

Get Current Qtr from different date fields

Hi - I have to get current Qtr and next Qtr from 2 different date fields from 2 diff. tables.How can I do that ?I have the attached MC.

Table1:

ID Date1

1  7/9/2020

2 7/9/2019

3 7/9/2021

Table 2:

ID Date2

1  6/9/2020

2 6/9/2019

3 6/9/2021

Then I have to replace the Qtr in the expression below.

I have 8 Expressions which should autoupdate for the rolling next 24 months.

Exp1 - 

=if(year([Date1])=2020 and 'Q' & ceil(month([Date1])/3) ='Q3'

and

 year([Date2])=2020 and 'Q' & ceil(month([Date2])/3) ='Q3','Current'

Exp2 - 

=if(year([Date1])=2020 and 'Q' & ceil(month([Date1])/3) ='Q4'

and

 year([Date2])=2020 and 'Q' & ceil(month([Date2])/3) ='Q4','Next1'

Exp3 - 

=if(year([Date1])=2021 and 'Q' & ceil(month([Date1])/3) ='Q1'

and

 year([Date2])=2021 and 'Q' & ceil(month([Date2])/3) ='Q1','Next2'

 

Thank you very much.

Labels (1)
0 Replies