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

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
krishna20
Specialist II
Specialist II

Date format

Hi Friends,

I'm having problem in date format.

=sum({$<TP_MONTH={$(=MAX(TP_MONTH)))-12)},TP_YEAR=,TP_MONTH=>}TP_GROSS)

I'm having in datamodelling TP_MONTH as JAN,FEB,MARCH,APR.....

How can i take in set analysis as 1,2,3..........

Can any one pls provide sample one..

Regards

Krishna

31 Replies
Not applicable

LYTD formula:

=if(

    vOptionCurrency = 1 and vOptionPremium = 1, Sum({<TP_Year,TP_Month,TP_New_Month={">=$(=date(yearstart(addyears(Max(TP_New_Month),-1)))) <=$(=date(addyears(Max(TP_New_Month),-1))) "}>}TP_NetPremium_LC_1),

     if(

    vOptionCurrency = 1 and vOptionPremium = 2, Sum({<TP_Year,TP_Month,TP_New_Month={">=$(=date(yearstart(addyears(Max(TP_New_Month),-1)))) <=$(=date(addyears(Max(TP_New_Month),-1))) "}>}TP_GrossPremium_LC_1),

    if(

    vOptionCurrency = 3 and vOptionPremium = 1, Sum({<TP_Year,TP_Month,TP_New_Month={">=$(=date(yearstart(addyears(Max(TP_New_Month),-1)))) <=$(=date(addyears(Max(TP_New_Month),-1))) "}>}TP_NetPremium_LC_3),

    if(

    vOptionCurrency = 3 and vOptionPremium = 2, Sum({<TP_Year,TP_Month,TP_New_Month={">=$(=date(yearstart(addyears(Max(TP_New_Month),-1)))) <=$(=date(addyears(Max(TP_New_Month),-1))) "}>}TP_GrossPremium_LC_3)))))

YTD formula:

=if(

    vOptionCurrency = 1 and vOptionPremium = 1, Sum({<TP_Year,TP_Month,TP_New_Month={">=$(=date(yearstart(Max(TP_New_Month)))) <=$(=date(Max(TP_New_Month))) "}>}TP_NetPremium_LC_1),

     if(

    vOptionCurrency = 1 and vOptionPremium = 2, Sum({<TP_Year,TP_Month,TP_New_Month={">=$(=date(yearstart(Max(TP_New_Month)))) <=$(=date(Max(TP_New_Month))) "}>}TP_GrossPremium_LC_1),

    if(

    vOptionCurrency = 3 and vOptionPremium = 1, Sum({<TP_Year,TP_Month,TP_New_Month={">=$(=date(yearstart(Max(TP_New_Month)))) <=$(=date(Max(TP_New_Month))) "}>}TP_NetPremium_LC_3),

    if(

    vOptionCurrency = 3 and vOptionPremium = 2, Sum({<TP_Year,TP_Month,TP_New_Month={">=$(=date(yearstart(Max(TP_New_Month)))) <=$(=date(Max(TP_New_Month))) "}>}TP_GrossPremium_LC_3)))))

krishna20
Specialist II
Specialist II
Author

Hi David,

Thank you very much..

Regards

Krishna