Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Merging different results into one based on different conditions

Hi All,

I have data as shown in below. Could some one suggest me to build stack barchart,  how to get Derive Line Name  and show sum() as shown in result set.

First three columns available in script. How to derive line name as Dimension? Sum of result set shown in last.

    

Line NameFamily NameQuantityDerive Line Name
A SalesZ100A
A SalesO90A
A SalesS70A
A SalesBF70A
A SalesE60A
A Sales OSE40A
A Sales OSS70A
A Sales OSZ70A
A Sales OSBF60A
A Stock SalesZ90A
A Stock SalesS70A
A Stock Sales OSS70A
NONEO60exclude in Chart
NONETREATMT40exclude in Chart
NONEGLAZING100exclude in Chart
NONETINT90T
NONECOAT70exclude in Chart
B SalesZ70B
B SalesBF60B
B SalesS40B
B SalesE70B
B Sales OSBF60B
C SalesBF40C
C SalesS100C
C SalesZ90C
C SalesE70C
C Sales OSS40C
C Sales OSBF70C
C Stock SalesZ70C

C Stock Sales

S60C
C Stock Sales OSS90C

Result set with expression:

  

Derived Line NameQuanity
Asum(A) - Sum(T)
TSum(T)
BSum(B)
CSum(C)

Please suggest me, is it possible to do with out touching script and just with Dimensions and Expressions?

Thanks to suggest.

Regards,

Krishna

14 Replies
techvarun
Specialist II
Specialist II

You have to use ValueList function to achieve the result.


From QlikHelp
http://help.qlik.com/en-US/sense/June2017/Subsystems/Hub/Content/ChartFunctions/SyntheticDimensionFu...

techvarun
Specialist II
Specialist II

Please refer the attached

Anonymous
Not applicable
Author

Hi Varun,

Could you give me an example with Sample data. I tried to understand from the above mentioned link. But bit confused.


Regards,

Krishna

techvarun
Specialist II
Specialist II

Sample qvw posted below. Please check

Anonymous
Not applicable
Author

Hi Varun,

Certainly, value list helped to an extent. Is there any possibility that, while sum we can count quantity of other dimension.

For simple data model i directly updated quantity in the morning. but in my application i need to sum/ count the quantity based on other dimension.

Thanks to confirm.

Anonymous
Not applicable
Author

Hi Varun,

For better understanding i attached excel sheet with sample table and info as comments. Thanks to advice. !

Kushal_Chawda

How would you define line name A,T,B & C also NONE, in your sample data I don't see it

Anonymous
Not applicable
Author

Hi Kushal,

Condition as below:

If(Line Name like"A S*", A,If(Line Name like "NONE" and Familyname "TINT", 'T', if(Line Name = "B S*", B, IF(LINE Name like 'C S*', C'))))

Finally Line Name NONE and Family Name <> TINT then it is NONE. Which i dont want to see in char sales.

Kushal_Chawda

see the attached