Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

comparing last year sales with current on basis of season code.

I am comparing current year with last two year sales in my dashboard but i also want that when i click on sales view (circled in black) the sales on basis of season code (like 17A ,17P) should also appear in charts so for that i need to combine following below mentioned expression

i want to combine two expressions  but following expression is giving an error .

=num(

sum({<Sold_year = {"$(=Max(Sold_Year)-2)" and [Season Code] = $(vSales_Summary_Previous_Season) > ([inv value]/Sales_INR_Unit,

'#,##0.0')paint1.png

5 Replies
devarasu07
Master II
Master II

Hi,

Try like this

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


Thanks,

Deva

Anonymous
Not applicable
Author

thanks I was able to write the following expression but now i want on selection of season from list box i want charts should depict the  sales in charts .

so for that i am using a variable in my expression as vSales_summary_Previous_Season and assigning a value as '17A' but its fixed .

now can you please help me how to declare a variable(vSales_summary_Previous_Season) for previous season   so that it can be made flexible ie when user selects a season from list on selection the data should be depicted in charts paint1.png

susovan
Partner - Specialist
Partner - Specialist

You can set the definition of  'vSales_summary_Previous_Season' as '=FieldName' i.e. flexible.

Warm Regards,
Susovan
Anonymous
Not applicable
Author

But here data is blank. on selection from list box the selection is captured in text box but not in charts if i am using above expression ie

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


paint1.png

Anonymous
Not applicable
Author

paint1.png

here expression is giving an error when taken in text box