Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Vasiliy_Beshentsev
Creator III
Creator III

Help with expression

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!

1 Solution

Accepted Solutions
Vasiliy_Beshentsev
Creator III
Creator III
Author

Because i found a good idea in new topic so thats is solution:

i decided to make new field Flag which contains when payment make2016-12-27 11_19_24-Microsoft SQL Server Management Studio - __Удаленное.png

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...

View solution in original post

27 Replies
MK_QSL
MVP
MVP

Sum(

     {<

     t35PRDWAER = {'RUB'},

     BVRPBEDVTZ = {"<=$(=Date((VTRBEGDVTR + year - (365/BVRZAHWVTR))))"}

     >}

DECNRPRDEC),

Anonymous
Not applicable

Hi,

Refer Set Analysis: syntaxes, examples for more on set analysis.

Vasiliy_Beshentsev
Creator III
Creator III
Author

it particulary works, but not at the end! ,

can you please rewrite at this part  {"<=$(=Date((VTRBEGDVTR + year - (365/BVRZAHWVTR))))"},

because Date() is convert all in () into date, but it incorrect. UPD1 in upperpost.

MK_QSL
MVP
MVP

Try

{"<=$(=(VTRBEGDVTR + year - (365/BVRZAHWVTR)))"},

Vasiliy_Beshentsev
Creator III
Creator III
Author

I tried to do like that, but it's doesn't work:

Sum(

     {<

     t35PRDWAER = {'RUB'},

     date(BVRPBEDVTZ) = {<=$(=(date(VTRBEGDVTR) + year - (365/BVRZAHWVTR)))}

     >}

DECNRPRDEC),

Anonymous
Not applicable

You cant use date(BVRPBEDVTZ) in set analysis.

Try BVRPBEDVTZ= {"<=$(=(date(VTRBEGDVTR + year - (365/BVRZAHWVTR))))"}

Vasiliy_Beshentsev
Creator III
Creator III
Author

doesn't work ((

Vasiliy_Beshentsev
Creator III
Creator III
Author

it doesn't work

MK_QSL
MVP
MVP

provide sample data..