Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
kunkumnaveen
Specialist
Specialist

how to write expression

Hello All,

            i need to show the list of all suppliers associated with a part but with nil transactions in the chosen period.let say i have sample data

year  Supplier    part      spend

2017      xxx        aaa          100

2017      yyy        bbb          200

2017      zzz        ccc          0

2017      zzz        ccc          100

2017      vvv        ddd          0

2016      yyy        bbb          0

2016      zzz        ccc          100

2016      zzz        ccc          0

2016      vvv        ddd          20

2015      yyy        bbb          10

2015      zzz        ccc          100

2015    zzz        ccc            50

2015      vvv        ddd          20

and if i choose 2017 so i need see below data(suppliers current year spend is nil and having some spend in previous year )

supplier         part        currentyear(2017)   previousyear(2016)

zzz              ccc           0                       100

vvv              ddd           0                       20

if i choose 2016 so i need see below data

supplier         part        currentyear(2016)   previousyear(2015)

yyy              bbb           0                     10

zzz              ccc           0                     150 (100+50)

I have not clue how to write a expression to achieve this requirement ,can any suggestion plz

thanks

16 Replies
kunkumnaveen
Specialist
Specialist
Author

can u post ur expressions as i am not allowed to copy this qvw to server

kunkumnaveen
Specialist
Specialist
Author

can u post ur expressions as i am not allowed to copy this qvw to server


current and previous year expressions

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

For Prev Year.

Sum({<Supplier =p({<spend = {"0"}>}),year = {"$(=max(year)-1)"}>}spend)


For Current Year

Sum({<spend = {"0"}>}spend)


Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Anonymous
Not applicable

Hi Naveen,

Try this

Current Year Expression:

Sum({<year={"=max(year)"}>}spend)

Prior Year Expression

Sum({<year={"=max(year)-1"}>}spend)

kunkumnaveen
Specialist
Specialist
Author

i have used ur current year

Untitled.png

kunkumnaveen
Specialist
Specialist
Author

Sum({<spenD = {"0"}>}spenD)

Kushal_Chawda

add previous year expression as well, because zero value is getting suppressed