Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
shekhar_analyti
Specialist
Specialist

How to segregate data based on appreciation or depreciation ?

Hi All ,

I want to segregate data based on one field value (Index) , where for a given vendor for given time period either value is appreciated or

depreciated .

In attached sample i have Data and expected output .

Thanks & Regards

Shekar

1 Solution

Accepted Solutions
tresesco
MVP
MVP

What if you put a count condition like:

If(Count(total <Vendors,Product, SubProduct> Value)>1,

          Max( {<Year={">=$(vStartYear)<=$(vEndYear)"}>}Value)

)

View solution in original post

9 Replies
shekhar_analyti
Specialist
Specialist
Author

Note : User have two input boxes to select start year and end year .. And between these the above apprection or deprection is to be segregated

tresesco
MVP
MVP

PFA

Capture.JPG

shekhar_analyti
Specialist
Specialist
Author

Hi Tresesco ,

Thanks for reply . But My expected output for Mvalue is

      

VendorsProductSubProductYearIndexValue
GintechSolar Cells 2016Mvalue30
GintechSolar Cells 2016Mvalue38
GintechSolar Cells 2017Mvalue42
Vikram SolarSolar CellsHedge2017Mvalue22
Vikram SolarSolar CellsHedge2016Mvalue32
PrimestoneVisualsSpy Cam2016Mvalue15
PrimestoneVisualsSpy Cam2015Mvalue16

But in your screenshot i see L&T and Primestone

L&T is a single vendor for which there is single entry hence we cannot

asscertain whether its Mvalue is incerasing or decreasing

With Primestone Mvalue is for two different subproduct , but requirement

is for similar sub product and product

Similarly Vikram Solar has an extra entry with subproduct infra , while

only two entries of vikram solar should have been there of product Solar cell

and Subproduct Hedge

tresesco
MVP
MVP

What if you put a count condition like:

If(Count(total <Vendors,Product, SubProduct> Value)>1,

          Max( {<Year={">=$(vStartYear)<=$(vEndYear)"}>}Value)

)

shekhar_analyti
Specialist
Specialist
Author

Hi Tresesco ,

Thanks . Above expression worked .

Please help me understand : Count(total <Vendors,Product, SubProduct> Value)  . What Total is exactly doing ?

tresesco
MVP
MVP

Total is a qualifier in qlik that defines/manipulates the aggregation level in charts. For better understanding, check these links:

Keywords : TOTAL, ALL &amp; DISTINCT

What does the TOTAL qualifier do?

shekhar_analyti
Specialist
Specialist
Author

Hi Tresesco ,

I find a issue with the above expression .

1) In straight table

The Moment i select 2016 as my start year the requirement takes beating , In below table Primestone Visuals Spy cam should not be in the table ... because it has no 2017 entry , so there is neither appreciation not depreciation can be estimated , hence this record should not have appeared in table

2) Pivot Table

How Can i have only those records for which value in both 2016 and 2017 is present ?

shekhar_analyti
Specialist
Specialist
Author

Since Tresesco is busy ..... stalwar1‌ .. expertise needed

sunny_talwar

May be this

If(Count({<Year={">=$(vStartYear)<=$(vEndYear)"}>} total <Vendors,Product, SubProduct> Value)>1,Max( {<Year={">=$(vStartYear)<=$(vEndYear)"}>}Value))