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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
subbareddykm
Creator II
Creator II

Selection

Hi All ,

I have a query based on period selection in my period.

Lets consider my requirement here like below.

If my selection is Year=2016 and Month = 06.and I have a Filters (YTD,MTD,PY Year)

If i slect YTD  Should show 2016.06 date only.

If i slect MTD Should show current - previous month data.

If i slect PY Year Last Year Current month - previous month data only.

Can any one tell me how to achieve this.

1 Reply
Anil_Babu_Samineni

Create ISLAND Table?

Load * Inline [

Selections

YTD

MTD

PY Year

];

ID is dimension

And use formula like below

Pick(Match(Selections, 'YTD','MTD','PY Year'),

     Sum(Sales),

     (Sum({<Month = {'$(=Max(Month))'}>}Sales)-Sum({<Month = {'$(=AddYears(Max(Month), -1))'}>}Sales)),

     (Sum({<Year = {'$(=AddYears(Max(Year), -1))'}, Month = {'$(=Max(Month))'}>}Sales)-Sum({<Year = {'$(=AddYears(Max(Year), -1))'}, Month = {'$(=Max(Month)-1)'}>}Sales))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful