Skip to main content
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!

27 Replies
Anonymous
Not applicable

Check the date format of field "BVRPBEDVTZ' and the value which you get from "=(date(VTRBEGDVTR) + year - (365/BVRZAHWVTR))". The format has to be same.

It would be great if you can share qvw with sample data.

Vasiliy_Beshentsev
Creator III
Creator III
Author

Friends! I convert all dates in main script!

When load data:

CAST(vtr1.VTRBEGDVTR as date) as VTRBEGDVTR,

CAST(vtr1.BVRPBEDVTZ as date) as BVRPBEDVTZ

Anonymous
Not applicable

Fields BVRPBEDVTZ & VTRBEGDVTR will be in date format, but need to confirm if "=(date(VTRBEGDVTR) + year - (365/BVRZAHWVTR))" returns value in same date format.

vinieme12
Champion III
Champion III

what is year in the below?

VTRBEGDVTR + year - (365/BVRZAHWVTR)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Vasiliy_Beshentsev
Creator III
Creator III
Author

that right question, i thought already that this is function!

i need to minus 1 year from VTRBEGDVTR but how to write correct?

i wrote incorrect, sorry, friend

MK_QSL
MVP
MVP

use

Date(AddYears(VTRBEGDVTR,-1))

or

AddYears(VTRBEGDVTR,-1)

Vasiliy_Beshentsev
Creator III
Creator III
Author

i replace this

Vasiliy_Beshentsev
Creator III
Creator III
Author

added sample data in post!

Vasiliy_Beshentsev
Creator III
Creator III
Author

added example in post, please, take a look!

Vasiliy_Beshentsev
Creator III
Creator III
Author

add an example in post! please, take a look!