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

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikview979
Specialist
Specialist

Based on selection Above all months data

Hi Experts,

Here i want the Sum(sales) based on month selection with above all months


For example:-

My variable like

Variable3=MonthName(max(Date))

expression:-

=sum({<Month={'$(Variable3)'}>}Sales)

Here if i select may month its showing may month data its fine.

my requirement is:-  if i select  APRIL i want data from April,Mar,Feb,Jan

for that i have written expression like this

=sum({<Month={'<=$(Variable3)'}>}Sales(here i am getting result is Zero)


is there any mistake in expression  ,please let me know.



36 Replies
qlikview979
Specialist
Specialist
Author

Good Anil, its working

but Why My expression is not working .

qlikview979
Specialist
Specialist
Author

Hi Bro,

Its not working ,The main thing is We are not able to check the Accumulation in Pivot Table.

Anil_Babu_Samineni

The main reason is you are en-counting the sum for Total Where Maximum date

<= Max(Month) -- Returns from Max date to Min Date

When we restrict Something in >= Condition it will consider as Min to Max. Here, Set analysis work as Conditional like >= and <= Condition

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
Kushal_Chawda

if it's working then can' t you use this expression?

Kushal_Chawda

try with this

sum({<Month={'<=$(Variable3)'},Month>}Sales)

qlikview979
Specialist
Specialist
Author

Not working Brother,

It was showing all months data

Kushal_Chawda

would you be able to share the sample?

qlikview979
Specialist
Specialist
Author

Hi Bro,

PFA

qlikview979
Specialist
Specialist
Author

Hi Anil,

This is good

sum({<Month={">=$(=YearStart(Max(Month))) <=$(=Max(Month))"}>}Sales) ( if i am select 2017 May its showing May and above all months)


The main thing if i select 2017 may ,i want to show  2017 may and above data in one column and 2016 may and above data in one column .

Output:-

Ex:-(if i select May 2017)

Year,     Monthname   2016        2017

               Jan2016        100          0

               Feb2016        200          0

2016        Mar2016        300          0

              April2016       400          0

               May2016       500           0

               Jan2017          0            600         

               Feb2017          0            700         

2017        Mar2017          0            800         

              April2017         0            900         

               May2017         0             1000   


      

if i select June i want to show both years  from June to January.



Regards,

Mahesh


ziadm
Specialist
Specialist

sum( aggr( rangesum( above( sum( {1<MonthName>}  Sales),0,3) ), MonthName))