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

Announcements
Only at Qlik Connect! Guest keynote Jesse Cole shares his secrets for daring to be different. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How do I create an expression

How do I create an expression when I want to compare total Inforce premium of June 2016 over July 2016?  (I am a newbie and not in IT). 

5 Replies
miguelbraga
Partner - Specialist III
Partner - Specialist III

Do the selection in Year 2016 and Monht July and then add these two expressions:

Current Month:

=max(Month)

Previous Month:

=Month(

          AddMonths(

                    Date(

                              makedate(Year, max(Month), 1)

                         )

               )

               ,-1

          )

)

Hope this helps you

Regards,

MB

sunny_talwar

For comparing inforce premium? I think OP might need this

Sum({<Date = {"$(='>=' & Date(MakeDate(2016, 6, 1), 'DateFieldFormatHere') & '<=' & Date(MonthEnd(MakeDate(2016, 6, 1)), 'DateFieldFormatHere'))"}>}[Inforce Premium])

/

Sum({<Date = {"$(='>=' & Date(MakeDate(2016, 7, 1), 'DateFieldFormatHere') & '<=' & Date(MonthEnd(MakeDate(2016, 7, 1)), 'DateFieldFormatHere'))"}>}[Inforce Premium])

krishnacbe
Partner - Specialist III
Partner - Specialist III

Hi,

Try with below expressions

Jun Month

=sum( {<Year={"2016"},Month={"Jun"}>}InsurancePremium)

July Month

=sum( {<Year={"2016"},Month={"Jul"}>}InsurancePremium)

If the month and year should be dynamic, then create a variable to calculate the same.

miguelbraga
Partner - Specialist III
Partner - Specialist III

I didn't understood that... You're right and OP should consider your answer as the correct one

Regards,

MB

sunny_talwar

Well, I don't think we are still there. I think these are static expression and I think OP might be looking for something more dynamic. This, to me, looks like just a start