Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
New to Qlik view.Please help
need to find increase/drop in sales between 2 dates selected from 2 different list boxes
(salesnew-salesold)/salesold
you can find the right syntax in the attachement.
There was just one waste equals sign in the expression, the correct expression should be
SUM({$< Weekend1 = {"$(vWeekend1)"}>} Amount)
greets,
Max
may be i did not explained it enough
user can pick 2 diff. dates from 2 diff list box and the result should be the drop/increase in sales.
(salesWeek1-salesweek2)/salesweek1
Message was edited by: sandeepteotia File is attached
Sandy,
Might be easier if you recreate this in another qvw and upload it, or just post the one you're working on. As you have explained it, it's tough to tell exactly what you're going for. There may be a better way to achieve your solution than you have considered.
Hi Sandy,
if i understand you correctly, i use a similar function in our main application.
We did not link the calendar dimension table to facts table. We use two variables holding the selected min and max date from the calendar listbox (only 1 calendar is used, and with min and max user selections of more than 2 values are compensated)
Your needed expression would then look like
sum({$< factsdate = {'=$(varDate1)'} >} sales) - sum({$< factsdate = {'=$(varDate2)'} >} sales) / sum({$< factsdate = {'=$(varDate1)'} >} sales)
The expression should work (except syntax errors) as long as you don't put a date(part) in the dimension
As i actually don't have access to a designer, i cannot test it
Hi Noster,
thank yu Noster.You mean the user need to select 2 dates from the same calendar listbox and then save them in 2 diff. variables
Hi Noster,
its picking the max and min weekend but the sales is picked as same amount.so the resultset is 0.
Am i missing something.
=sum({$< Weekend = {'=$(vWeekend1)'} >} Amount)-sum({$< Weekend = {'=$(vWeekend2)'} >} Amount)
Put the Set Analysis expressions in separate columns to locate errors
Week1 : sum({$< Weekend = {'=$(vWeekend1)'} >} Amount)
Week2: sum({$< Weekend = {'=$(vWeekend2)'} >} Amount)
and check if their results are correct. Perhaps it's justed caused by missing brackets or the like
Hi Nostor,
File is attached. I tried doing that.I missed something.
thank you very much for your help.
you can find the right syntax in the attachement.
There was just one waste equals sign in the expression, the correct expression should be
SUM({$< Weekend1 = {"$(vWeekend1)"}>} Amount)
greets,
Max
it works. thanks Max!!!!!!!!!!