Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Good day, everyone!
I have some throuble with expr. I need to get sum(Sales) over my filter.
On first page i got total sum, it work correct:
Sum({<t35PRDWAER = {'RUB'}>} DECNRPRDEC),
where t35PRDWAER field is currency, DECNRPRDEC is sales
On second page i want to get this, but it doesn't work:
Sum({<t35PRDWAER = {'RUB'}, BVRPBEDVTZ <= (VTRBEGDVTR + year - (365/BVRZAHWVTR))>} DECNRPRDEC),
where BVRPBEDVTZ is date of sale, VTRBEGDVTR is another date field, BVRZAHWVTR is something else.
Please, help me write expression correct.
UPD1: MY FALSE, FRIENDS, i forget to tell that i got 'YYYYMMDD' format in date fields!
UPD2: HERE IS EXAMPLE.QVF, take a look, friends!
Hello, can someone help me now?
Hi,
can you confirm what are you trying to acheive here? YTd, previous year??
(date(VTRBEGDVTR) + year - (365/BVRZAHWVTR)
Sum(
{<
t35PRDWAER = {'RUB'},
BVRPBEDVTZ = {"<=$(=Date( AddYears(VTRBEGDVTR,1) - (365/BVRZAHWVTR) ,'YYYYMMDD' )}
>}
DECNRPRDEC),
Hello!
Yes, previous year, update simplyfied condition here Re: Expression doesn't work (
so is this resolved now?
Maybe this is what you want?
Sum ({<t35PRDWAER = {'RUB'}, VTRBEGDVTR = {"=MakeDate(Year(VTRBEGDVTR), Month(VTRBEGDVTR), Day(VTRBEGDVTR))>=AddYears(MakeDate(Year(BVRPBEDVTZ), Month(BVRPBEDVTZ), Day(BVRPBEDVTZ)), -1)"}>} DECNRPRDEC)
It works, but unfortunately shows incorrect sum. It's good solution to replace fields, but not in this case
Position of fields in condition is mean, i update simplyfied condition here, take a look Re: Expression doesn't work (
Well i guess yes, due to the fact that it was revising the terms of the problem (see new discuss)
Because i found a good idea in new topic so thats is solution:
i decided to make new field Flag which contains when payment make
so now i need to thing how to divide this two sum(sales) into 2 KPI in qlik sense: first year payments and next years
upd: and i find the decision
i use
1. Sum({<t35PRDWAER = {'RUB'}, FlagYearPayment = {'next'}>} DECNRPRDEC) for next years payments
2. Sum({<t35PRDWAER = {'RUB'}, FlagYearPayment = {'first'}>} DECNRPRDEC) for first year payments
still search for decision un expressions in qlik sense...