Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
mdmukramali
Specialist III
Specialist III

Each Year Month Sales

Dear All,

I have a requirement. where end user wants to see the each year last month( Max_Month)  sales.

if no selection on months than,

2010- DEC sales

2011- DEC sales

2012- DEC Sales

2013- DEC sales

2014- DEC sales

2015- APR Sales.

if he makes any selection on month filters than that month sales need to see in all the years.

And i need to take year as dimension.

so please any suggestions on above requirement.

Thanks,

Mukram.

1 Solution

Accepted Solutions
pokassov
Specialist
Specialist

Hi, Mohammed!

First of all, we could add flag FinalMonth in our Calendar table, to use it in set analysis to select last months.

expr1: sum({$<FinalMonth={1}>}sales)

Then we could add variable "vMonth": =if(GetSelectedCount(Месяц)>0, false(),true())

Finally you can write expression:

if(vMonth, $(expr1), sum({$<Month={$(=max(Month))}>} sales)

Sergey

View solution in original post

7 Replies
Not applicable

hi,

=sum({<FinYear={'2015'}>} sales)

=sum({<FinYear={'2014'}>} sales)

when you will select any month it will give month results.else it will give whole year sales value.

Regards

Vimlesh

mdmukramali
Specialist III
Specialist III
Author

Dear Gupta,

i need Max Month Sales for each Year without any selection.( default )

Not applicable

hi,

pass your month in this set analysis through variable or by hard coded.

sum({<FinYear={'2015'}, month={'Apr'}>} sales)

or

sum({<FinYear={'2015'}, month={=$(vmaxmonth)}>} sales)

Regards

Vimlesh

Not applicable

hi,

sum({$<AYear={$(vYear)},Months={$(vMonth)},Day={$(vDay)} >}[sales])

here if you want by pass values means you put Day=  means no effect of day selection in this set analysis

sum({$<AYear={$(vYear)},Months={$(vMonth)},Day= } >}[sales])

Regards

Vimlesh

pokassov
Specialist
Specialist

Hi, Mohammed!

First of all, we could add flag FinalMonth in our Calendar table, to use it in set analysis to select last months.

expr1: sum({$<FinalMonth={1}>}sales)

Then we could add variable "vMonth": =if(GetSelectedCount(Месяц)>0, false(),true())

Finally you can write expression:

if(vMonth, $(expr1), sum({$<Month={$(=max(Month))}>} sales)

Sergey

nagarjuna_kotha
Partner - Specialist II
Partner - Specialist II

Hi Mohamad,

Yes We can do that,

use below expression

if (getselected count(plant)=0,

Sum({< Dept={'Sales'} , Plant={'Total'} Value}

,

Sum({< Dept={'Sales'} ,  Value}

)))

Try this....

mdmukramali
Specialist III
Specialist III
Author

Dear ,

Thanks for your help.

i did something like this.

1)

Created a FLAG in the Back End.

if(MONTH=MAX_MONTH,1,0) AS FLAG.

2)

Created a Variable.

vMonth=if(GetSelectedCount(MONTH)>0, 0,1)

3)

Expression:

=if(vMonth=1, (Sum({<FLAG={'1'}>}BUDGET)+Sum({<FLAG={'1'}>}INCOME)),

(sum({$<MONTH={$(=max(MONTH))}>} BUDGET)+sum({$<MONTH={$(=max(MONTH))}>} INCOME)))

Thanks,

Mukram