Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Vasiliy_Beshentsev
Creator III
Creator III

Expression doesn't work (

Hello, again, friends!

Yesterday i ask you to (Help with expression)

I simplified condition - now i need to take sum of sales on this: BVRPBEDVTZ >= VTRBEGDVTR + 1 year.

And now it looks like this:

Sum(

    {<

    t35PRDWAER = {'RUB'},

    BVRPBEDVTZ = {>=$(AddYears(VTRBEGDVTR,1))}

    >}

DECNRPRDEC)


But it still doesn't work , AddYears() function is become gray in code 


Please, someone help me

Example in attach

1 Solution

Accepted Solutions
Vasiliy_Beshentsev
Creator III
Creator III
Author

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

5 Replies
marcohadiyanto
Partner - Specialist
Partner - Specialist

Hi Vasiliy,

I think you should add your script to compare BVRPBEDVTZ and VTRBEGDVTR then you can add it to your set analysis.

If you want to get result

Sum(

    {<

    t35PRDWAER = {'RUB'},

    BVRPBEDVTZ = {>=$(Date(AddYears(max(VTRBEGDVTR),1),'YYYY-MM-DD'))}

    >}

DECNRPRDEC)


The value of your set analysis won't return 1 single value so BVRPBEDVTZ return nothing, that's why i adding max so i get 1 single value.

Regards,

Marco

Vasiliy_Beshentsev
Creator III
Creator III
Author

sure i compare this dates now is ssms 2016-12-27 10_55_10-Microsoft SQL Server Management Studio - __Удаленное.png

Vasiliy_Beshentsev
Creator III
Creator III
Author

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

Vasiliy_Beshentsev
Creator III
Creator III
Author

Hey, Marco! Youк thoughts about compare this 2 fields with dates hepls me to find the right solution! Cheers!

marcohadiyanto
Partner - Specialist
Partner - Specialist

Hi Vasiliy,

Cheers!

It's better to compare on script level and it's easier rather than we search how set analysis works.

Regards

Marco