Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to use current selection function for comparison of sales on basis of various seasons

Hi

i want to compare sales ie current year and previous year sales on basis of selection of season code from same  list boxes

so for current season i have declared variable as

vSales_summary_current_season=GetCurrentfeild([Season Code])

vSlaes_Summary_Current_Season=GetCurrentFeild(season code)-1)

expression for previous year season

Num( sum({$<Sold_year ={"$(=max(Sold_year)-1)"},season={$(vSales_Summary_Previous_Season)-1}>} [inv value]/Sales_INR_Unit ), '#,##0.0')

the above expression is giving an error

expression for current year

Num( sum({$<Sold_year ={"$(=max(Sold_year)-1)"},season={$(vSales_Summary_current_Season)}>} [inv value]/Sales_INR_Unit ), '#,##0.0')

finalsales.png

10 Replies
Anil_Babu_Samineni

But, GetCurrentField() function returns only Field Name, How you want to publish and generate ??

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
Anonymous
Not applicable
Author

i want when i select a season from list box which is present under (select previous season) then the corresponding sale should be present under (previous year season ) in chart

and similarly when i select a season code from (select current season) then the corresponding sales should be present under current year season in chart so for that are my expression's and variables declared correct?

Anonymous
Not applicable
Author

Num( sum({$<Sold_year ={"$(=max(Sold_year)-1)"},season={$(vSales_Summary_Previous_Season)-1}>} [inv value]/Sales_INR_Unit ), '#,##0.0')

the above expression is giving an error

Have you declared (Assigned) the variable    " vSales_Summary_Previous_Season "any where ?

Anonymous
Not applicable
Author

yes i have declared the above variable as following:-

vSlaes_Summary_previous_Season=GetCurrentFeild(season code)-1) but its giving an error so what changes should i do to make it functinable?

Anil_Babu_Samineni

The way your way is won't possible, Instead you can try something like below. then we can talk about Variable definition later..

Num( sum({$<Sold_year ={"$(=max(Sold_year)-1)"},season={"$(=GetFieldSelections(GetCurrentField([Season Code])))"}>} [inv value]/Sales_INR_Unit ), '#,##0.0')

OR

Num(sum({$<Sold_year ={"$(=AddYears(max(Sold_year),-1))"},season={$(=Concat(Chr(39) & GetFieldSelections(GetCurrentField([Season Code])) & Chr(39), ',')}>} [inv value]/Sales_INR_Unit ), '#,##0.0')

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
martinpohl
Partner - Master
Partner - Master

the better way to compare selections is to work with alternate state

see this

Alternate States ‒ QlikView

Regards

Anonymous
Not applicable
Author

its giving 0 vales in chart

Anil_Babu_Samineni

Please start filter from [Season Code]? And check

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
Anonymous
Not applicable
Author

well its functioning for previous season but for current season what should be the expression?